TCL 电子邮件脚本无法在 Activestate TCL 中提供 [英] TCL Email Script doesn't deliver in Activestate TCL

查看:23
本文介绍了TCL 电子邮件脚本无法在 Activestate TCL 中提供的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 TCL 的 MAC OSX 版本上运行了以下脚本,它运行良好,但它挂在 Windows 7 机器上的 ActiveState TCL 上

I ran the following script on the MAC OSX version of TCL and it worked fine however it hangs on ActiveState TCL on a Windows 7 machine

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 的全新安装,几天前下载.)

Any ideas what could be wrong on the Activestate system? (It's a fresh install of Activestate, downloaded it a couple days ago.)

更新:我认为由于公司防火墙的原因,它被冻结了(我必须和某人谈谈.)然而,虽然我在不通过公司网络的情况下可以走得更远,但它仍然无法传递信息.我得到以下调试信息:

UPDATE: I think it was freezing due to the corp firewall (I'll have to talk to someone about that.) HOWEVER While I can get farther when not going through the corp network it still doesn't deliver the message. I get the following debug info back:

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 机器上使用相同的凭据,但似乎授权失败?还有什么想法吗?

The script is using the same credentials on both the MacOS machine and the Windows/Activestate machine, but it seem to be failing authorization? Any further ideas?

推荐答案

您似乎没有尝试进行身份验证.在您的 Mac 上,您的 Tcl 安装可能包含来自 Tcllib 的 SASL 包,而您可能没有将它包含在您的 Windows 机器上.没有 SASL 可用并不是错误,因为许多人不必进行身份验证,但您显然需要它.您可以使用 teacup 实用程序将 SASL 包添加到您的 ActiveTcl 安装中.teacup install SASL 应该可以.该软件包支持 LOGIN 和 PLAIN SASL 机制,它们在 TLS 链接上运行良好.

It looks like you are not attempting to authenticate. On you Mac, your Tcl installation probably includes the SASL package from Tcllib and you may not have included it on your Windows machine. Not having SASL available is not an error as many people do not have to authenticate but you clearly require it. You can use the teacup utility to add the SASL package to your ActiveTcl install. teacup install SASL should do it. The package supports the LOGIN and PLAIN SASL mechanizms which are fine over a TLS link.

这篇关于TCL 电子邮件脚本无法在 Activestate TCL 中提供的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆