Email with multiple attachments & HTML body


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Email with multiple attachments & HTML body
# 1  
Old 12-29-2010
Email with multiple attachments & HTML body

I have a html file:

Code:
# cat sample.html
<html>
<body>
Sample HTML file</p>
</body>
</html>

And I have two excel sheets (sheet1.xls & sheet2.xls)
I want to send an email by having the sample.html as the message body and two spreadsheets as the attachments.
I tried using the below command:

Code:
(cat sample.html; uuencode sheet1.xls sheet1.xls; uuencode sheet2.xls sheet2.xls) | mailx -m -s "Test Mail 
Content-type: text/html" "recipient address"

We are getting the message body, but the attachments are missing in the email. If I remove the "Content-type: text/html", then I am getting both attachment and the message body, but the message body is coming with html tags and they are actually not getting parsed.

Please provide me a solution.

Last edited by Scott; 02-24-2011 at 03:47 PM.. Reason: Code tags
# 2  
Old 12-29-2010
WIKIPEDIA has an excellent article on MIME messages, it is a good place to start. See MIME - Wikipedia, the free encyclopedia.
# 3  
Old 12-29-2010
This was answered just a little while ago...search the forums.
Short answer: you can't get attachments and HTML with sendmail.
I believe the solution was to use the mutt email client.
# 4  
Old 12-29-2010
You can use sendmail to send html message body with attachments...

https://www.unix.com/302111802-post2.html
# 5  
Old 02-08-2011
I was looking for the similar kind of example without any attachments. How do I go with this on AIX.

I removed the related ATTACH code and also tried with
uuencode --base64
(and )
uuencode ${1} ${1}

but it was hang, appreciate your help.
# 6  
Old 02-08-2011
You just want to send an HTML email (and you use AIX)?
This User Gave Thanks to purdym For This Post:
# 7  
Old 02-14-2011
Thanks .. I could able to do it.. So much of good information .. keep sharing..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Email Using uuenview w/ Multiple Attachments

HP-UX mbhp7640 B.11.31 U ia64 4294967295 unlimited-user license Our database builds a MIME compliant html email, then cats that to sendmail - no problem. Due to horrible issues with the native uuencode, we long ago began using uuenview to encode our attachments - no problem. An example is... (1 Reply)
Discussion started by: bubba77
1 Replies

2. Shell Programming and Scripting

Regarding guidance related to HTML table in email body

Hello All, I have a query here. I am sending an HTML table(which I am creating it by a call to REST API, in a LINUX box) and from there I have to send it into an email. So following are the poins on same: As data is not static so it is writing Dynamic data and creating HTML file. There is... (9 Replies)
Discussion started by: RavinderSingh13
9 Replies

3. Shell Programming and Scripting

HTML table in email body using C Shell

I am using Sun Solaris ver. 5.10 and trying to send an HTML table in email body using mail command in C shell script. I tried following commands:- #1 mail -m "MIME-Version: 1.0;Content-type:text/html;charset=UTF-8" receiver@mail.com < file.html #2 mail -m "Content-type: text/html;" -s "This... (4 Replies)
Discussion started by: jnrohit2k
4 Replies

4. Shell Programming and Scripting

SQL query output convert to HTML & send as email body

Hi , I have a sql query in the unix script ,whose output is shown below.I want to convert this output to HTML table format & send email from unix with this table as email body. p_id src_system amount 1 A 100 2 B 200 3 C ... (3 Replies)
Discussion started by: jagadeeshn04
3 Replies

5. Shell Programming and Scripting

Email body not formatted with html and sendmail

Hi All, I am trying to send the contents of a file as email body. I am using html email and sendmail option of unix. I am using the below piece of code for the same : #!/usr/bin/ksh export MAILTO="email@domain.com" export SUBJECT="Report" export BODY="file_directory_path/test_file.txt"... (1 Reply)
Discussion started by: rockygsd
1 Replies

6. Shell Programming and Scripting

Sending an email with a body and attachments using uuencode

Hi, Im having a bit of an issue with using the uuencode command and sending out an email. My aim is to send an email out which has a body and also have attachments. Currently I can either get one or the other and not both on the same email. uuencode... (4 Replies)
Discussion started by: 02JayJay02
4 Replies

7. UNIX for Advanced & Expert Users

Mutt for html body and multiple html & pdf attachments

Hi all: Been racking my brain on this for the last couple of days and what has been most frustrating is that this is the last piece I need to complete a project. There are numerous posts discussing mutt in this forum and others but I have been unable to find similar issues. Running with... (1 Reply)
Discussion started by: raggmopp
1 Replies

8. Shell Programming and Scripting

How to send email with multiple attachments ?

Hello , I am trying to send an email with two attachments . I have tried all previous suggestion in this forum but none worked. I could send one attachment in an email by uuencode $file "$file" | mailx -m -s "File" xxx@xx.com but unable to send multiple attachments . I have tried ... (8 Replies)
Discussion started by: RaviTej
8 Replies

9. Red Hat

Send HTML body and HTML attachment using MUTT command

Hi there.. I need a proper "mutt" command to send a mail with html body and html attachment at a time. Also if possible let me know the other commands to do this task. Please help me.. (2 Replies)
Discussion started by: vickramshetty
2 Replies

10. Shell Programming and Scripting

Referring to attached images in html email body through mailx

encoding type for images? (5 Replies)
Discussion started by: biswasbaishali
5 Replies
Login or Register to Ask a Question