フィルターのクリア

Error using sendmail - Could not connect to SMTP host: smtp.gmail.com, port: 25;

21 ビュー (過去 30 日間)
KCG
KCG 2017 年 5 月 17 日
回答済み: fbaillon 2017 年 8 月 4 日
I"m trying to send Email from my Matlab to my Email account. I used the following code:
props = java.lang.System.getProperties; props.setProperty('mail.smtp.auth','true'); setpref('Internet','SMTP_Server','smtp.gmail.com'); setpref('Internet','SMTP_Username','myGmailuserName@gmail.com'); setpref('Internet','SMTP_Password','myGmailPasword'); subject='first mail from my Matlab'; sendmail('myGmailuserName@gmail.com',subject)
But received the following error message:
"Error using sendmail (line 171) Could not connect to SMTP host: smtp.gmail.com, port: 25;"
I would be grateful to anyone willing to help. Eitam Luz

回答 (1 件)

fbaillon
fbaillon 2017 年 8 月 4 日
You must enable StartTLS and spécifie the port :
props.setProperty( 'mail.smtp.starttls.enable', 'true' );
props.setProperty( 'mail.smtp.socketFactory.port', '587' );
This answer is a bit late, but if it can still help you...
Fabien Baillon

カテゴリ

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