Reply To: Email attachmant in tcl

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Email attachmant in tcl Reply To: Email attachmant in tcl

#59823
Scott Lee
Participant

    Carl,  

    We are on 3.8.1 on HP-UX.  Here is what I came up with.  This attaches a unix text file, adds .txt to it to the file name, and a windows email client will see that it has a text mime type.  Attachement filename below would be in.12345.txt.

    Code:


    #list of addresses to send the message to
    set emaillist “scott@st-claire.org cloveradmin@st-claire.org”

    #body of the email message
    set msg “This is the text in the body of the message”

    #file to be attached to the email
    set filename “in.12345”
    set tmpfile “/tmp/$filename”

    #unix commands to use
    set ux2dos “/usr/bin/ux2dos”
    set uuencode “/usr/bin/uuencode”
    set mailx “/usr/bin/mailx”

    exec $ux2dos $tmpfile | $uuencode $filename.txt | $mailx -ms “This is the subject linen$msg” $emaillist

    #optional – remove the original file
    exec rm $tmpfile

    HTH,

    Scott