开发者

Missing TCL package smtp

I'm using activestate TCL which I thought was suppose to include smtp in the default install.

However when I run the following example (From the documentation):

proc send_simple_message {recipient email_server subject body} {
    package require smtp
    package require mime
    set token [mime::initial开发者_C百科ize -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."

I get the following error:

can't find package smtp

Is there something I have to do to enable the package in Activestate TCL?


Install the smtp package from the ActiveState repository with teacup -

c:\> teacup install smtp
Resolving smtp ...   (etc)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜