<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Send mails with attachments in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728086#M836366</link>
    <description>I thought I would give my favorite "mail/attach" solution.&lt;BR /&gt;#&lt;BR /&gt;# Now send report to "sendto" via email&lt;BR /&gt;#&lt;BR /&gt;mailx -m -s "${subject}" ${sendto} 1&amp;gt;/dev/null &amp;lt;&amp;lt; __EOF__&lt;BR /&gt;$(cat ${attachment} | ux2dos - | uuencode ${atach_name}.txt)&lt;BR /&gt;&lt;BR /&gt;... Body of message ...&lt;BR /&gt;__EOF__&lt;BR /&gt;&lt;BR /&gt;Using this method, you can have as many attachments as you want and put them anywhere in the body of the message. For binary files  remove the "ux2dos" conversion.</description>
    <pubDate>Wed, 22 May 2002 11:58:45 GMT</pubDate>
    <dc:creator>Rich Wright</dc:creator>
    <dc:date>2002-05-22T11:58:45Z</dc:date>
    <item>
      <title>Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728079#M836359</link>
      <description>Hello experts,&lt;BR /&gt;&lt;BR /&gt;i need some precious guidelines.&lt;BR /&gt;&lt;BR /&gt;I need to send files (text, compressed, postscript or PDF) as email attachments. &lt;BR /&gt;&lt;BR /&gt;I have an application generating the following parameters which i wish to forward to an email address:&lt;BR /&gt;===============================================&lt;BR /&gt;$1  Mail destination address&lt;BR /&gt;$2  Subject of Message&lt;BR /&gt;$3  Text file containing message&lt;BR /&gt;$4  Either 'delete' or 'nodelete' for $3&lt;BR /&gt;$5  Attach file (Output file which i want to send as attachment)&lt;BR /&gt;$6  Either "delete" or "nodelete" for $5&lt;BR /&gt;===============================================&lt;BR /&gt;&lt;BR /&gt;After generating these values, my application will be calling a unix shell script. &lt;BR /&gt;e.g. (Makes $5 the mail body content.)&lt;BR /&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;L-9iAS: d05/9iAS/6iserver/reports60/admin/mail&amp;gt;more r60mail.sh&lt;BR /&gt;#!/bin/csh -f&lt;BR /&gt;#   Send mail message using Unix 'mail'.&lt;BR /&gt;#-------------------------------------&lt;BR /&gt;&lt;BR /&gt;#   Send mail message using 'mail'.&lt;BR /&gt;#   When attachment exists, send attachment which is report output.&lt;BR /&gt;#   When attachment doesn't exist, send message file which is notification.&lt;BR /&gt;if ($5 == '') then&lt;BR /&gt;  mail $1 &amp;lt; $3&lt;BR /&gt;else&lt;BR /&gt;  mail $1 &amp;lt; $5&lt;BR /&gt;endif&lt;BR /&gt;&lt;BR /&gt;#   Delete the message file.&lt;BR /&gt;if ($4 == 'delete') then&lt;BR /&gt; rm $3&lt;BR /&gt;endif&lt;BR /&gt;#   Delete the attach file.&lt;BR /&gt;if ($6 == 'delete') then&lt;BR /&gt; rm $5&lt;BR /&gt;endif&lt;BR /&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;&lt;BR /&gt;I have alread tried to use uuencode: &lt;BR /&gt;/usr/bin/uuencode $5 $5 | mailx -m -s $2 $1&lt;BR /&gt; &lt;BR /&gt;Does not help much. The files attached comes out garbled!&lt;BR /&gt;&lt;BR /&gt;It seems like i am having a MIME type issue. &lt;BR /&gt;I believe the use of ELM would be most appropriate here.&lt;BR /&gt;&lt;BR /&gt;Anybody who has something working similar to this?&lt;BR /&gt;&lt;BR /&gt;thank you in advance for a reply.&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Yogeeraj&lt;BR /&gt;&lt;BR /&gt;PS. i also tried to install "nail". It gives me an error during the make.&lt;BR /&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;root-L1000 #make&lt;BR /&gt;        cd . &amp;amp;&amp;amp; /depot/nail-9.30/missing autoheader&lt;BR /&gt;sh: /depot/nail-9.30/missing: Execute permission denied.&lt;BR /&gt;*** Error exit code 126&lt;BR /&gt;&lt;BR /&gt;Stop.&lt;BR /&gt;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;</description>
      <pubDate>Tue, 21 May 2002 09:30:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728079#M836359</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2002-05-21T09:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728080#M836360</link>
      <description>check this link &lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x41950559ff7cd4118fef0090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x41950559ff7cd4118fef0090279cd0f9,00.html&lt;/A&gt;</description>
      <pubDate>Tue, 21 May 2002 09:33:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728080#M836360</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2002-05-21T09:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728081#M836361</link>
      <description>&lt;BR /&gt;replace mail -x with sendmail, eg;&lt;BR /&gt;&lt;BR /&gt;uuencode /etc/hosts /etc/hosts | sendmail &lt;DESTINATION&gt;&lt;BR /&gt;&lt;BR /&gt;And it shall come through as an attachment.&lt;BR /&gt;&lt;/DESTINATION&gt;</description>
      <pubDate>Tue, 21 May 2002 09:33:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728081#M836361</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-05-21T09:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728082#M836362</link>
      <description>Robin's script in this link&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://bizforums.itrc.hp.com/cm/QuestionAnswer/1,,0x19e3ff77de2bd611abd50090277a778c,00.html" target="_blank"&gt;http://bizforums.itrc.hp.com/cm/QuestionAnswer/1,,0x19e3ff77de2bd611abd50090277a778c,00.html&lt;/A&gt;</description>
      <pubDate>Tue, 21 May 2002 09:35:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728082#M836362</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2002-05-21T09:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728083#M836363</link>
      <description>Yogeeraj,&lt;BR /&gt;&lt;BR /&gt;for i in `echo filename1 filename2 filename3 ...`&lt;BR /&gt;do&lt;BR /&gt;uuencode $i $i.txt&lt;BR /&gt;done|mailx -m -s "test" username@whereever.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The key is to have the right "suffix" on the uuencode line:&lt;BR /&gt;&lt;BR /&gt;uuencode somefile somefile.pdf&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 21 May 2002 10:27:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728083#M836363</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-05-21T10:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728084#M836364</link>
      <description>hello,&lt;BR /&gt;&lt;BR /&gt;my attachment can be of any type!&lt;BR /&gt;&lt;BR /&gt;how do i modify my script for it to work?&lt;BR /&gt;&lt;BR /&gt;Also, if i was to modify the sender name and add a footer to each message sent?&lt;BR /&gt;E.g.&lt;BR /&gt;***********************************************&lt;BR /&gt;The attached document has been autogenerated by CMT applications.&lt;BR /&gt;&lt;BR /&gt;If you are not the addressee indicated in this message (or responsible for delivering the message to the intended recipient), you should not read it, nor copy or deliver this message to anyone.  ***********************************************&lt;BR /&gt;&lt;BR /&gt;thank you in advance&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Yogeeraj&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;#!/bin/csh -f &lt;BR /&gt;if ($5 == '') then &lt;BR /&gt;mail $1 &amp;lt; $3 &lt;BR /&gt;else &lt;BR /&gt;/usr/bin/uuencode $5 $5 | mailx -m -s $2 $1 &lt;BR /&gt;endif &lt;BR /&gt;&lt;BR /&gt;# Delete the message file. &lt;BR /&gt;if ($4 == 'delete') then &lt;BR /&gt;rm $3 &lt;BR /&gt;endif &lt;BR /&gt;# Delete the attach file. &lt;BR /&gt;if ($6 == 'delete') then &lt;BR /&gt;rm $5 &lt;BR /&gt;endif &lt;BR /&gt;--------------------------------------------</description>
      <pubDate>Tue, 21 May 2002 11:28:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728084#M836364</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2002-05-21T11:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728085#M836365</link>
      <description>&lt;BR /&gt;To add a footer first direct the output of your uuencode to a file;&lt;BR /&gt;&lt;BR /&gt;uuencode &lt;FILE&gt; &lt;NAME&gt;  &amp;gt; /tmp/temp.$$&lt;BR /&gt;&lt;BR /&gt;echo "Disclaimer .....blah blah blah" &amp;gt;&amp;gt;/tmp/temp.$$&lt;BR /&gt;&lt;BR /&gt;Now your file /tmp/temp.$$ has your uuencoded file AND the disclaimer at the bottom.&lt;BR /&gt;&lt;BR /&gt;Now you can send it using sendmail;&lt;BR /&gt;&lt;BR /&gt;cat /tmp/temp.$$ | sendmail &lt;DESTINATION&gt;&lt;BR /&gt;&lt;BR /&gt;Note, its very difficult to put a subject line on sendmail so try to get away without one.&lt;BR /&gt;&lt;/DESTINATION&gt;&lt;/NAME&gt;&lt;/FILE&gt;</description>
      <pubDate>Tue, 21 May 2002 11:47:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728085#M836365</guid>
      <dc:creator>Stefan Farrelly</dc:creator>
      <dc:date>2002-05-21T11:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728086#M836366</link>
      <description>I thought I would give my favorite "mail/attach" solution.&lt;BR /&gt;#&lt;BR /&gt;# Now send report to "sendto" via email&lt;BR /&gt;#&lt;BR /&gt;mailx -m -s "${subject}" ${sendto} 1&amp;gt;/dev/null &amp;lt;&amp;lt; __EOF__&lt;BR /&gt;$(cat ${attachment} | ux2dos - | uuencode ${atach_name}.txt)&lt;BR /&gt;&lt;BR /&gt;... Body of message ...&lt;BR /&gt;__EOF__&lt;BR /&gt;&lt;BR /&gt;Using this method, you can have as many attachments as you want and put them anywhere in the body of the message. For binary files  remove the "ux2dos" conversion.</description>
      <pubDate>Wed, 22 May 2002 11:58:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728086#M836366</guid>
      <dc:creator>Rich Wright</dc:creator>
      <dc:date>2002-05-22T11:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728087#M836367</link>
      <description>I use elm for this, which encodes for you.  You have to build an include file for elm, but is relatively easy.  I went this route after some problems with winders seats and uuencoded files from HP-UX.&lt;BR /&gt;&lt;BR /&gt;Sniplett from script:&lt;BR /&gt;BINDIR=/usr/bin&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;$BINDIR/touch /usr/local/squid/etc/mailer.txt&lt;BR /&gt;echo "[include /var/tmp/proxy_report.$DATE.zip application/octet-stream base64]" &amp;gt;&amp;gt;/usr/local/squid/etc/mailer.txt&lt;BR /&gt;$BINDIR/elm -s "Proxy Report" JohnDoe@Nowhere.com &lt;BR /&gt;I had lots of problems with sendmail with this, but some say it's easy.  Just make sure your version of elm supports attachments.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Wed, 22 May 2002 13:04:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728087#M836367</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2002-05-22T13:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728088#M836368</link>
      <description>Hi Yogee&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Here is an link which will help you :&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.stokely.com/unix.sysadm.resources/email.html#attachment.link" target="_blank"&gt;http://www.stokely.com/unix.sysadm.resources/email.html#attachment.link&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;there are a variety of software like mpack etc which just need a single command to be type to send any type of attachments.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Manoj Srivastava</description>
      <pubDate>Wed, 22 May 2002 13:11:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728088#M836368</guid>
      <dc:creator>MANOJ SRIVASTAVA</dc:creator>
      <dc:date>2002-05-22T13:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728089#M836369</link>
      <description>Hi Yogee,&lt;BR /&gt;&lt;BR /&gt;I had been using this:&lt;BR /&gt;&lt;BR /&gt;(&lt;BR /&gt;echo "Subject: Text in the subject line"&lt;BR /&gt;echo "Text in email body"&lt;BR /&gt;&lt;BR /&gt;uuencode &lt;FULLPATHFILENAMEONHPBOX&gt; &lt;FILENAMEINOUTLOOK&gt; &lt;BR /&gt;) | /usr/sbin/sendmail recipient@comp.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This works fine. You can add needed extension to &lt;FILENAMEINOUTLOOK&gt; to open it with appropriate appl in windows.&lt;BR /&gt;&lt;BR /&gt;Andrej&lt;BR /&gt;&lt;/FILENAMEINOUTLOOK&gt;&lt;/FILENAMEINOUTLOOK&gt;&lt;/FULLPATHFILENAMEONHPBOX&gt;</description>
      <pubDate>Thu, 23 May 2002 12:46:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728089#M836369</guid>
      <dc:creator>Andrej Vavro</dc:creator>
      <dc:date>2002-05-23T12:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Send mails with attachments</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728090#M836370</link>
      <description>Thank you everybody for you replies.&lt;BR /&gt;&lt;BR /&gt;I have temporarily done the following modifications to my scripts:&lt;BR /&gt;===============================================&lt;BR /&gt;...&lt;BR /&gt;if ($5 == '') then&lt;BR /&gt;   mail $1 &amp;lt; $3&lt;BR /&gt;else&lt;BR /&gt;   if (`ls $5|cut -f 2 -d"."` == 'txt') then&lt;BR /&gt;      echo "`cat $3` \n[include $5 text/plain base64]"|elm -s "$2" $1&lt;BR /&gt;   else if (`ls $5|cut -f 2 -d"."` == 'pdf') then&lt;BR /&gt;      echo "`cat $3` \n[include $5 application/pdf base64]"|elm -s "$2" $1&lt;BR /&gt;   else if (`ls $5|cut -f 2 -d"."` == 'htm') then&lt;BR /&gt;      echo "`cat $3` \n[include $5 text/html base64]"|elm -s "$2" $1&lt;BR /&gt;   else&lt;BR /&gt;      mail $1 &amp;lt; $5&lt;BR /&gt;   endif&lt;BR /&gt;endif&lt;BR /&gt;#   Delete the message file.&lt;BR /&gt;if ($4 == 'delete') then&lt;BR /&gt; rm $3&lt;BR /&gt;endif&lt;BR /&gt;#   Delete the attach file.&lt;BR /&gt;if ($6 == 'delete') then&lt;BR /&gt; rm $5&lt;BR /&gt;endif&lt;BR /&gt;...&lt;BR /&gt;===============================================&lt;BR /&gt;&lt;BR /&gt;Hope that i have not missed out anything.&lt;BR /&gt;&lt;BR /&gt;Best regards &lt;BR /&gt;yogeeraj</description>
      <pubDate>Sat, 25 May 2002 10:09:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/send-mails-with-attachments/m-p/2728090#M836370</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2002-05-25T10:09:07Z</dc:date>
    </item>
  </channel>
</rss>

