看板 MATLAB 關於我們 聯絡資訊
我嘗試想要使用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
MPL:自問自答,最後發現是學校檔掉了 回家一用就有...- - 02/04 15:30
yehjfu:我一開始也不能用,後來把Mail改成MailAdress 05/27 16:39
yehjfu:原來是我之前打錯,mail就可以了.... = = 05/28 20:40