缺少TCL包smtp

时间:2011-09-08 16:17:56

标签: scripting smtp tcl

我正在使用activestate TCL,我认为它假设在默认安装中包含smtp。

但是,当我运行以下示例时(来自文档):

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 \\
    -recipients $recipient -servers $email_server
    mime::finalize $token
}
send_simple_message someone@somewhere.com localhost \\
    "This is the subject." "This is the message."

我收到以下错误:

can't find package smtp

在Activestate TCL中启用软件包是否需要做些什么?

1 个答案:

答案 0 :(得分:4)

使用teacup -

从ActiveState存储库安装smtp软件包
c:\> teacup install smtp
Resolving smtp ...   (etc)