HTML mail with Attachment


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting HTML mail with Attachment
Prev   Next
# 1  
Old 08-20-2015
HTML mail with Attachment

Hi,
I am using the below code:
Code:
 #!/bin/ksh
 SUBJ="Send mail from Unix with file attachments"
TO=sudha.viswanathan@jpmorgan.com
CC=sudha.viswanathan@jpmorgan.com
(
cat << !
To : ${TO}
Subject : ${SUBJ}
Cc : ${CC}
!
 
cat << !
MIME-Version: 1.0
Content-Type: text/html
`cat DM_WRK_RECON_CHK.html`
!
 
`uuencode DM_WRK_RECON_CHK.csv DM_WRK_RECON_CHK.csv`
!
 ) | /usr/sbin/sendmail -v ${TO} ${CC}

This is sending the mail with the HTML body correctly formatted but the attachment is missing.

Strangely, if I remove the below two lines,the attachment and the body is mailed fine. But, the body loses it's html formatting. Please assist.

Code:
 MIME-Version: 1.0
Content-Type: text/html

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in sending html mail with attachment

Hi Everyone, I am facing problems in sending html mail with attachemnt. I will able to send mail with attachment (plain text ) using mailx -s and uuencode command and also html mail without attachment using sendmail option. However I am not able to send html mail along with attachment.Either... (2 Replies)
Discussion started by: karthik adiga
2 Replies

2. Shell Programming and Scripting

[SOLVED] Read html attachment from /var/mail

Hi, I am receiving an email to the server with a html attachment. When I check the /var/mail the attachment is showing as junk characters. I want to move that html file to a particular location in that server. Please help me. Regards Neethu (4 Replies)
Discussion started by: Neethu
4 Replies

3. Shell Programming and Scripting

MIME - HTML mail with Excel attachment - Please help!

#!/bin/ksh ( echo "MIME-Version: 1.0" echo "Content-Type: multipart/mixed; boundary=frontier" echo "--frontier" echo "Content-Type: text/html" echo "Content-Disposition: inline" echo "\n" echo "<html><body><h1>this is html formatted text</h1></body></html>" echo "--frontier" echo... (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

4. Shell Programming and Scripting

Unable to send mail with inline html along with attachment. Please help!

The below code is not working. I am able to send only inline html or only attachment. When trying to do both, only inline html is sent without attachment. Please help! #!/bin/ksh (echo "Subject: Test Mail - HTML Format" echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo... (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

5. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

6. UNIX for Advanced & Expert Users

Unknown Attachment received on html mail

Hello, Getting an extra attachment when i send a mail using below code. The body and the rest of the attachments look very fine. The extra attachment to be exact has a name ATT00001.txt. :confused: This is not part of my $attach_list. BOUNDARY='------The Boundary-----' print - "From:... (1 Reply)
Discussion started by: pgop
1 Replies

7. Shell Programming and Scripting

Sending HTML attachment through mail

Hi I am new to unix and scripting.I am trying to send a html file as an attachment. SUBJECT="Type of Exceptions in Application" TO=Sushovan.Samals@gmail.com SPOOLFILE=/data/reg/tlogs/Monitor.html #echo "Send the E-mail message..." uuencode $SPOOLFILE $SPOOLFILE | mailx -s "$SUBJECT" $TO... (2 Replies)
Discussion started by: sushovan
2 Replies

8. AIX

Command line/Script to send E-mail with HTML body and binary attachment

I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum: 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... (3 Replies)
Discussion started by: G-Man
3 Replies

9. UNIX for Dummies Questions & Answers

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... (4 Replies)
Discussion started by: G-Man
4 Replies

10. Shell Programming and Scripting

Send an attachment and html text both in the same mail

Hi all, I am working on UNIX (Solaris28). I would like to send an email in which the body will be in html format and, in the same mail, a xls file has to be attached. I have tried this: the file is correctly attached but the body comes as html source and not formatted. If I do not attach the... (4 Replies)
Discussion started by: stefan.yu
4 Replies
Login or Register to Ask a Question
CLAWS-MAIL-HTML2-VIEWER(1)				      General Commands Manual					CLAWS-MAIL-HTML2-VIEWER(1)

NAME
claws-mail-html2-viewer -- Renders HTML mail using the gtkhtml2 rendering widget. DESCRIPTION
This manual page documents briefly the claws-mail-html2-viewer This manual page was written for the Debian distribution because the original program does not have a manual page. claws-mail-html2-viewer is a plugin (loadable module) for the Claws Mail mailer. This plugin enables viewing HTML mails (and HTML attachments) within the Claws Mail message window using the gtkhtml2 widget for the ren- dering. USAGE
Before using a plugin you must instruct Claws Mail to load it on startup. For this you must go ``Configuration'' menu on main window toolbar, open ``Plugins...'' dialog, click on the ``Load plugin...'' button and select the plugin file, named gtkhtml2_viewer.so, and press the ``Open'' button. SEE ALSO
claws-mail (1), claws-mail-extra-plugins (1). AUTHOR
claws-mail-html2-viewer was written by iSteve isteve@bofh.cz and Colin Leroy colin@colino.net This manual page was written by Ricardo Mones mones@debian.org for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. CLAWS-MAIL-HTML2-VIEWER(1)