如何使用mathematica發送郵件?

SendMail[]函數似乎不好用了,返回一個錯誤:

SendMail::msgerr: An unexpected response was received during message transport.

這個錯誤在幫助文檔中也沒有說明。


我試了在 OS X 10.11.1 上用 Mathematica 10.3 在兩個 Gmail 賬戶間發 email,沒問題。

In[6]:= SendMail["To" -&> "
AAA@gmail.com", "Subject" -&> "XXX",
"Body" -&> "XXX", "From" -&> "BBB@gmail.com",
"Server" -&> "smtp.gmail.com", "UserName" -&> "BBB",
"Password" -&> Automatic, "PortNumber" -&> 587,
"EncryptionProtocol" -&> "StartTLS"]

Out[6]= {"MessageID" -&> "20040979177293164123.5.WolframLanguage.BBB@gmail.com"}

In[16]:= SystemInformation["Small"]
Out[16]= {Kernel-&>{SystemID-&>MacOSX-x86-64,ReleaseID-&>10.3.0.0 (5416302, 2015100902),CreationDate-&>Fri 9 Oct 2015 18:38:23GMT-8.},FrontEnd-&>{OperatingSystem-&>MacOSX,ReleaseID-&>10.3.0.0 (5416302, 2015100903),CreationDate-&>Fri 9 Oct 2015 19:32:00GMT-8.}}

登陸 BBB gmail 賬戶確實收到這封信了。這個 BBB Gmail 賬號設置了 『Allow less secure apps: ON":

https://myaccount.google.com/security?utm_source=OGB#connectedapps

Mathematica 軟體 bug 或運行異常最有效求解途徑應該是問 Wolfram客服。應該至少提供以下信息:

1. 軟體版本。Mathematica 的問題的話,給 SystemInformations["Small"] 執行結果即可。

2. 可以體現所述問題的完整程序。最簡單的就是附上你的 .nb 文件。


update Java?

MathGroup Archive: June 2010 [00112]

Hi Luis,

This problem occurs with SendMail because of an issue Apple introduced with
Java for Mac OS X 10.6 Update 1. It also affects Import from https sites in
Mathematica.

Updating to the latest Java for Mac OS X 10.6 Update 2 should address the
issue.

Regards,

Lambert Chao
lambertc at wolfram.com
Software Technology
Wolfram Research, Inc.

-----Original Message-----
From: l-mathgroup-bounces at wolfram.com
[mailto:l-mathgroup-bounces at wolfram.com] On Behalf Of telefunkenvf14
Sent: Sunday, June 06, 2010 5:42 AM
To: mathgroup at smc.vnet.net
Subject: [mg110218] [mg110176] Re: SendMail under Mac OS X

On Jun 5, 6:31 am, Luis & wrote:
&> Dear all,
&>
&> In my laptop running Mac OS X (10.6.3) I can not send an email using
&> the function SendMail (under Linux operative system the code works)
&> Mathematica version 7.0 1.0:
&>
&> SendMail["To" -&> "x... at gmail.com",
&> "Subject" -&> "GMail Test Message",
&> "Body" -&> "Test email sent via GMail.",
&> "From" -&> "x... at gmail.com", "Server" -&> "smtp.gmail.com",
&> "PortNumber" -&> 587, "EncryptionProtocol" -&> "StartTLS",
&> "UserName" -&> "x... at gmail.com", "Password" -&> Automatic]
&>
&> Output-&> SendMail::"msgerr" : "
&> StyleBox["\"& message
&> transport.&>\"", "MT"] ButtonBox["",
&> Appearance-&>{Automatic, None},
&> BaseStyle-&>"Link",
&> ButtonData:&>"paclet:ref/SendMail",
&> ButtonNote-&>"SendMail::msgerr"] "
&>
&> Any suggestion?
&> All my best,
&> Luis


推薦閱讀:

為什麼在 Mathematica 中使用循環是低效的?
如何實現任意精度計算?
學習 Mathematica 有什麼推薦書籍?
Mathematica 直接計算二重極限(double limit)的格式是什麼?
你對即將發布的 Mathematica 11 有什麼期待?

TAG:WolframMathematica |