我跑TCL的MAC OSX版本下面的腳本,它工作得很好但是它掛在ActiveState公司TCL在Windows 7機器上TCL電子郵件的腳本在ActiveState公司不提供TCL
proc send_simple_message {recipient email_server subject body} {
package require smtp
package require mime
set token [mime::initialize -canonical text/plain -string $body]
mime::setheader $token Subject $subject
smtp::sendmessage $token \
-ports 587 \
-debug 1\
-username [email protected] \
-password myPassword \
-recipients $recipient -servers $email_server
mime::finalize $token
}
send_simple_message [email protected] smtp.gmail.com \
"This is the subject." "This is the message."
任何想法在Activestate系統上可能會出錯? (這是一個新安裝的ActiveState的,下載了前幾天。)
更新: 我認爲這是由於CORP防火牆冷凍(我得找人傾訴一下。) 無論其在當不通過公司網絡時,我可以走得更遠,它仍然不傳遞信息。 我得到以下調試信息回:
Trying smtp.gmail.com...
<-- 220 mx.google.com ESMTP d8sm8712528ibl.1
--> EHLO ush10900dv (wait upto 300 seconds)
<-- 250-mx.google.com at your service, [32.178.65.125]
<-- 250-SIZE 35882577
<-- 250-8BITMIME
<-- 250-STARTTLS
<-- 250 ENHANCEDSTATUSCODES
--> STARTTLS (wait upto 300 seconds)
<-- 220 2.0.0 Ready to start TLS
--> EHLO ush10900dv (wait upto 300 seconds)
<-- 250-mx.google.com at your service, [32.178.65.125]
<-- 250-SIZE 35882577
<-- 250-8BITMIME
<-- 250-AUTH LOGIN PLAIN XOAUTH
<-- 250 ENHANCEDSTATUSCODES
--> MAIL FROM:<[email protected]> SIZE=245 (wait upto 600 seconds)
<-- 530-5.5.1 Authentication Required. Learn more at
<-- 530 5.5.1 http://mail.google.com/support/bin/answer.py?answer=14257 d8sm8712528ibl.1
--> RSET (wait upto 0 seconds)
--> QUIT (wait upto 0 seconds)
handshake failed: resource temporarily unavailable
while executing
"::tls::handshake $state(sd)"
invoked from within
"smtp::sendmessage $token -ports 587 -debug 1 -username [email protected]
腳本使用MacOS的計算機和Windows/ActiveState的機器上都相同的憑據,但它似乎沒有授權?還有什麼想法?
您是否注意到帶有URL的530消息?這可能爲你解答。 –
你應該(a)向MIME消息添加一個From頭,或者(b)爲smtp :: sendmessage命令指定'-originator'選項。 –
我確實注意到了530,但它可以在一個版本上運行,但不能在另一個版本上運行,並且具有相同的用戶名和密碼。所以我不確定爲什麼它給了我一個授權錯誤。 – NoMoreZealots