[設定] 請問有人知道如何用MATLAB寄信到gmail嗎?
我嘗試想要使用MATLAB寄信到我的gmail
網路上看到有人的設定如下
--
% Define these variables appropriately:
mail = 'an.example.email.address@gmail.com'; %Your GMail email address
password = 'testing1234'; %Your GMail password
% Then this code will set up the preferences properly:
setpref('Internet','E_mail',mail);
setpref('Internet','SMTP_Server','smtp.gmail.com');
setpref('Internet','SMTP_Username',mail);
setpref('Internet','SMTP_Password',password);
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.port','465');
% Send the email. Note that the first input is the address you are sending
the email to
sendmail('an.example.email.address@gmail.com','Test from MATLAB','Hello! This
is a test from MATLAB!')
--
可是我依照他的指令之後 都會得到這樣的錯誤
Error using ==> sendmail at 168
Could not connect to SMTP host: smtp.gmail.com, port: 25;
Connection timed out: connect
也嘗試找了其他人的程式 可是都是遇到同樣的錯誤
不知道版友有沒有人剛好知道怎麼設定
謝謝了!
--
mpl@Swinburne University of Technology, Melbourne,袋鼠國
http://blog.yam.com/mplnote
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 136.186.19.184
→
02/04 15:30, , 1F
02/04 15:30, 1F
→
05/27 16:39, , 2F
05/27 16:39, 2F
→
05/28 20:40, , 3F
05/28 20:40, 3F