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)
精彩评论