Reply To: Email from Tcl

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Email from Tcl Reply To: Email from Tcl

#57987
John Harvey
Participant

    Hi, I had issues with this proc for longest time.

    I’m using much the same proc as you are.  This proc takes the default user of the system and assumes it as an official e-mail address. With e-mail being as it is lately (spam, virus and whatever else can wreck a system), some systems won’t accept a message from whatever the default is.  

    You can override who the e-mail is from within the procedure, just add the highlighted code where you see it, or take this whole proc as is:

    proc send_mail_message {recipient email_server subject body} {

       package require smtp

       package require mime

       set from_address “your_email@whatever.bla

       set token [mime::initialize -canonical text/plain -string $body]

       mime::setheader $token Subject $subject

       smtp::sendmessage $token -recipients $recipient -servers $email_server -originator $from_address

       mime::finalize $token

    }

    I’m not sure this is your solution, but it’s worth trying I suppose.  Also, we had issues where the virus protection software on the server was preventing e-mail from even leaving the system.  Depending on what that is for you, that may also be something worth looking into…hope this helps!

    😀