我正在使用 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 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8af9e5e7efe5e4efcaf9e5e7effde2eff8efa4e9e5e7" rel="noreferrer noopener nofollow">[email protected]</a> localhost \\
"This is the subject." "This is the message."
我收到以下错误:
can't find package smtp
我需要做什么才能在 Activestate TCL 中启用该软件包吗?
最佳答案
使用 teacup
从 ActiveState 存储库安装 smtp 包 -
c:\> teacup install smtp
Resolving smtp ... (etc)
关于scripting - 缺少 TCL 包 smtp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7351276/