Unknown SMTP host: smtp.gmail.com; smtp.gmail.com
이전 댓글 표시
HI, I'm from India.
I want to send message to a mobile to get others alert. The following code i have found from the matlab user community.
When I run the code, the error iam facing is
Unknown SMTP host: smtp.gmail.com;
smtp.gmail.com
addrs = 'username@gmail.com' ;
pwd = 'xxxxx' ;
setpref('Internet','E_mail',addrs) ;
setpref('Internet', 'SMTP_Server', 'smtp.gmail.com');
setpref('Internet', 'SMTP_Username', addrs);
setpref('Internet', 'SMTP_Password',pwd);
props = java.lang.System.getProperties ;
props.setProperty('mail.smtp.auth','true') ;
props.setProperty('mail.smtp.socketFactory.class','javax.net.ssl.SSLSocketFactory') ;
props.setProperty('mail.smtp.socketFactory.fallback','false') ;
props.setProperty('mail.smtp.socketFactory.port','465') ;
sendmail(addrs,'test','anil') ;
Please help me in resolving this error.
Thanks in advance for your help.
답변 (1개)
Walter Roberson
2016년 3월 6일
If you are using MS Windows, then use the Windows "Nslookup" command to explore whether your system can resolve the address of smtp.gmail.com . See https://technet.microsoft.com/en-us/library/cc725991.aspx
In particular, try
! nslookup -querytype=a smtp.google.com. ns3.google.com
If that succeeds then try also
! nslookup -querytype=a smtp.google.com.
which will give you a hint about whether your default nameserver is able to find the information. It is possible that somehow you have no nameserver configured or that the nameserver that you have configured is having problems reaching the appropriate name service. If you are connected to an internet provider it is common for your system to be configured to use DHCP that automatically configures a nameserver, but sometimes you need to configure your system according to static nameserver information provided by your internet company.
카테고리
도움말 센터 및 File Exchange에서 Web Services에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
