开发者

Missing TCL package smtp

开发者 https://www.devze.com 2023-04-03 18:57 出处:网络
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):

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

精彩评论

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

关注公众号