Version 9 of smtp

Updated 2002-07-17 21:37:20

Documentation can be found at http://tcllib.sourceforge.net/doc/smtp.html


Here's a minimal useful example:

      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 [email protected] localhost \
                "This is the subject." "This is the message."

OK, this is more minimal:

         ...
      set token [mime::initialize -canonical text/plain -string $body]
      smtp::sendmessage $token \
              -header [list Subject $subject] \
              -header [list To $recipient]
      mime::finalize $token
         ...

This last one didn't work for me; I kept getting an error from sendmessage about { } not being a valid option. -- WHD.

WHD, CL will make a point of returning in July 2002 to address this error. What's above certainly worked with ... well, *some* version.


Category Package, subset Tcllib