Error using sendmail (line 172)

3 ビュー (過去 30 日間)
Andy Andrianandraina
Andy Andrianandraina 2015 年 11 月 9 日
コメント済み: Walter Roberson 2018 年 9 月 22 日
Hello, Does someone can help me,
the fact is : I obtain the following error when using the function sendmail
Error using sendmail (line 172)
Could not connect to SMTP host: smtp.gmail.com, port: 25;
Network is unreachable: connect
I am using matlab R2013b (8.2.0.701) with windows 7 My computer is in a network using proxy and I already configure the proxy for matlab internet connection in preferences > Web > Internet connection. When I test the connection it marks Success! And the gmail that I use for login open when using firefox. Thanks in Advance Andy
  2 件のコメント
riaz khan
riaz khan 2018 年 9 月 22 日
編集済み: Walter Roberson 2018 年 9 月 22 日
can any one help me plz
Error in VideoReader (line 172)
obj.init(fileName);
Error in Untitled8 (line 1)
trafficVid = VideoReader('1.avi')
Walter Roberson
Walter Roberson 2018 年 9 月 22 日
riaz khan please create a new Question for that. When you do, post the complete error message.

サインインしてコメントする。

回答 (1 件)

Shruti Sapre
Shruti Sapre 2015 年 11 月 16 日
Hi Andy,
MATLAB started using Java 7 from R2013b. Java 7 uses IPv6 by default.
Could you please try the below workaround:
1) At the command line, enter:
>> which -all java.opts
If it says "'java.opts' not found.", then proceed to step 2.
2) Go to your MATLAB startup directory. Create a file "java.opts" with the below one line:
-Djava.net.preferIPv4Stack=true
3) Restart MATLAB, and try the "sendmail" function again.
If a "java.opts" file was already found in step 1, open that file. Copy and paste this line into that file:
-Djava.net.preferIPv4Stack=true
Save the file, then restart MATLAB.
This will tell MATLAB's version of Java to use IPv4 for communication when possible.
Hope this helps!
-Shruti
  1 件のコメント
Andy Andrianandraina
Andy Andrianandraina 2015 年 11 月 17 日
Hi Shruti Sapre, Thanks for your answer. Effectively there was no java.opts in my matlab but although I create the file in the bin directory the problem stays the same, I have the following error :
Error using sendmail (line 172)
Could not connect to SMTP host: smtp.gmail.com, port: 25;
Permission denied: connect
Error in envoie_mail (line 76)
I think that the problem come from the proxy server here in my company :-( which does not allow sending mail using smtp, because I tried to launch the same program at home it worked perfectly. Wish you to have a nice day. Andy

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeWeb Services についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by