The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to send an email with some body content and attachment balireddy_77 Shell Programming and Scripting 2 08-20-2008 03:33 AM
Command line/Script to send E-mail with HTML body and binary attachment G-Man AIX 3 04-18-2007 06:30 PM
Send an attachment and html text both in the same mail stefan.yu Shell Programming and Scripting 4 10-26-2006 06:46 PM
sending mails with attachment and also some text in mail body guptan UNIX for Advanced & Expert Users 7 05-25-2006 03:17 AM
Send Mail with attachment and a body manojram How do I send email? 4 04-26-2004 08:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-15-2007
Registered User
 

Join Date: Mar 2007
Posts: 5
Stumble this Post!
AIX send mail with HTML message body and a binary attachment

I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements:
1. command line switch to specify file name containing message body in HTML format
2. command line switch to specify file name of a binary attachment
3. command line or input file to specify recipients (both to:, cc: and bcc
4. command line to specify From: address
5. command line to specify mail subject (subject text may include spaces)

I've tried every combination redirecting and piping uuencode and mail/mailx you could ever come up with with no luck.

The stumbling block is the HTML message body. Attaching a binary file to a text message body is a no brainer but I have to have the message body in HTML because we are using formatted tables.

Any help would be greatly appreciated.

Thanks.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-15-2007
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Stumble this Post!
Try something like....
Code:
$ cat ./mailheader
To: you@there.com
From: me@here.com
MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Subject: Hello
$ cat ./mailbody
<center><h1>Hello</h1></center>
Will this work?<br><b>Yes</b>
$ cat ./mailheader ./mailbody | /usr/lib/sendmail -t
Cheers
ZB
Reply With Quote
  #3 (permalink)  
Old 03-15-2007
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
Stumble this Post!
Just read your additional requirement RE: attachment...

Code:
 ( cat ./mailheader ./mailbody && uuencode attachment.txt attachment.txt ) | /usr/lib/sendmail -t
Cheers
ZB
Reply With Quote
  #4 (permalink)  
Old 03-19-2007
Registered User
 

Join Date: Mar 2007
Posts: 5
Stumble this Post!
Followed your syntax and while it does send the body of the mail in HTML format it does not add the binary attachment.

Any other suggestions?
Reply With Quote
  #5 (permalink)  
Old 03-22-2007
Registered User
 

Join Date: Mar 2007
Posts: 5
Stumble this Post!
Bump.

Any assistance would be greatly appreciated.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
mailx, mailx attachment

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0