我在 TCL 的 MAC OSX 版本上运行了以下脚本,它运行良好,但是它挂在 Windows 7 机器上的 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 myAccount@gmail.com \
-password myPassword \
-recipients $recipient -servers $email_server
mime::finalize $token
}
send_simple_message myAccount@gmail.com smtp.gmail.com \
"This is the subject." "This is the message."
任何想法 Activestate 系统可能有什么问题?(这是 Activestate 的全新安装,几天前下载了它。)
更新:我认为由于公司防火墙而冻结(我将不得不与某人谈谈。)但是,虽然我可以在不通过公司网络时走得更远,但它仍然没有传递消息。我得到以下调试信息:
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:<peddy@ush10900dv> 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 username@gmail.com
该脚本在 MacOS 机器和 Windows/Activestate 机器上使用相同的凭据,但似乎授权失败?还有什么想法吗?