我跑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