The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 06:33 AM
Command line/Script to send E-mail with HTML body and binary attachment G-Man AIX 3 04-18-2007 09:30 PM
Send an attachment and html text both in the same mail stefan.yu Shell Programming and Scripting 4 10-26-2006 09:46 PM
sending mails with attachment and also some text in mail body guptan UNIX for Advanced & Expert Users 7 05-25-2006 06:17 AM
Send Mail with attachment and a body manojram How do I send email? 4 04-26-2004 11:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-15-2007
G-Man G-Man is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 5
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.
  #2 (permalink)  
Old 03-16-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
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
  #3 (permalink)  
Old 03-16-2007
zazzybob's Avatar
zazzybob zazzybob is offline Forum Advisor  
Registered Geek
  
 

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

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

Join Date: Mar 2007
Posts: 5
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?
  #5 (permalink)  
Old 03-22-2007
G-Man G-Man is offline
Registered User
  
 

Join Date: Mar 2007
Posts: 5
Bump.

Any assistance would be greatly appreciated.
Sponsored Links
Closed Thread

Bookmarks

Tags
mailx, mailx attachment

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:19 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0