Problem with : Error using sendmail; Can't send command to SMTP host; Remote host closed connection during handshake
显示 更早的评论
Hi I am trying to sendmail using the below, but i get :
Error using sendmail; Can't send command to SMTP host; Remote host closed connection during handshake
mail='#mail@mail';
password='#password';
server = '#smtp.server.com';
Subject = 'Test';
Text = 'Test';
setpref('Internet','E_mail', mail);
setpref('Internet','SMTP_Server', server);
setpref('Internet','SMTP_Username', mail);
setpref('Internet','SMTP_Password', password);
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.port', '587');
props.setProperty('mail.smtp.starttls.enable','true');
sendmail('#mail@mail', Subject, Text)
Any ideas what the problem is and how to fix it?
Thank you
2 个评论
Amanda Fortuna
2024-4-15
Hi,
I'm having the same issue. Did you get this resolved? If so would you mind sharing the resolution please.
Thank you.
Rajanya
2024-8-9
Can you please specify the version of MATLAB that you are using and also the mail server you are trying to establish a connection on? I tried the same code as provided above using outlook smtp server on MATLAB R2024a and did not get any error.
Thanks.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Web Services 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!