Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email with attachments in HP-UX

Status
Not open for further replies.

Johnathon

Programmer
Jul 29, 2006
23
US
Writing a shell script which will auto send email to user with multiple attachments. Mail format include Sender, Reeceiver, Subject , Body text etc. Any body know the way? using sendmail or elm?
 
You can use the following command sequence to accomplish a binary attachment to mailx.

# uuencode binfile binfile > binfile.uu
# mailx -s &quot;subject&quot; recipient < binfile.uu

Also, more than one uu file can be prepared and appended to the message.

Hope this helps,

Regards,

Carlos Almeida,

 
Thanks Carlos Almeida,
That'll will give me a encode format. I need send attachments as it is, ie need not to decode. I realise the following command will to that :
uuencode file file | sendmail xxxx@XXX.com
But how to change the From:, Subject: and insert in the boby messages? and the way to send multiple files as one go.
 
Hi Carlos Almeida,
Many thanks..........
This is what i'm looking for. I'll try it this coming Monday.
Have a nice week end.

Best Regards,
Johnathon
 
Hi Johnathon,
You are looking for this.
uuencode filename filename | mailx -m -s &quot;Subject is ...&quot; my.name@my.company.com

This will send your filename as attachment. Don't forget -m and filename twice.

Sachin
 
Hi Sachin,
Thanks. it work, but i need to change the From field , likely to have ability to write some body text.

I tried out Carlos Almeida's way, it work fine with a single attachment. Two attachments and more will results in some attachment appear in encoded format.
Carlos Almeida, do u know why?


 
Hi Carlos Almeida,
Sorry , my mistake. It work with multiple attachments. Now i'm try out to mail them out from my HP-UX to outside world.

Best Regards,
Johnathon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top