Email attachmant in tcl

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Email attachmant in tcl

  • Creator
    Topic
  • #48825
    Carl Duff
    Participant

      We send emails and pages via tcl for monitoring of most of our production threads and it works fine.

      I now need to be able to send a text file as an attachment to the emails and can’t seem to make it work. If anyone has a simple example or information they’d be willing to share it would be much appreciated.

      Thanks in advance for any information provided!!

      Carl

    Viewing 0 reply threads
    • Author
      Replies
      • #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

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.