Matlab 7.10.0 (R2010a) 版本的Sendmail函式

 

 

 

 

如果沒有set環境參數的帳號密碼的話可能會出現錯誤(網路上可google到)

故整理後的sendmail code為以下:

 

% Define these variables appropriately:
setpref('Internet','SMTP_Server','smtp.gmail.com');
setpref('Internet','SMTP_Username','你的帳號@gmail.com');
setpref('Internet','SMTP_Password','密碼');

%  正式sendmail
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth','true');
props.setProperty('mail.smtp.socketFactory.port','465');
props.setProperty('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');
sendmail('你的帳號@gmail.com','TITLE:You''re cool!', ...
'See the attached files for more info.',{'D:\Users\collin\Documents\ECG_0530.mat'});

 

 

但運作的時候還是會遇到錯誤 Orz

如下

 

sendmail_error  

 

最後的解決方法...

居然是關閉防毒軟體 Orz 然後就可以正常運作了

在google搜尋好久都找不到解答

(有看到其他外國朋友也遇到同樣無法執行的問題但沒看到解答)

記錄下來,以後有遇到的人也可以參考一下>"<

 

MATLAB參考資料 :

1. How do I use SENDMAIL to send email from MATLAB 7.2 (R2006a) via the GMail server or Yahoo server?

http://www.mathworks.com/support/solutions/en/data/1-3PRRDV/

2. How To Send E-Mail From MATLAB

http://obasic.net/how-to-send-e-mail-from-matlab

 

 

arrow
arrow

    花花兒♥ 發表在 痞客邦 留言(0) 人氣()