![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HTML message with attachment (text-file) | Felix2511 | UNIX for Dummies Questions & Answers | 2 | 09-12-2007 02:59 AM |
| Command line/Script to send E-mail with HTML body and binary attachment | G-Man | AIX | 3 | 04-18-2007 09:30 PM |
| AIX send mail with HTML message body and a binary attachment | G-Man | UNIX for Dummies Questions & Answers | 4 | 03-22-2007 02:15 PM |
| How to send a mail with an attachment from AIX 5.2 OS? | mintu41 | AIX | 1 | 01-30-2006 12:02 PM |
| Send Mail with attachment and a body | manojram | How do I send email? | 4 | 04-26-2004 11:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 file (I remove the "uuencode file.xls file.xls"), then theI receive the correct body format (the html is correctly formatted) cat /tmp/body.html ; uuencode file.xls file.xls ) | /usr/lib/sendmail -t "myname@mydomain.com" The body.html file contains the following text: From: myname2@mydomain.com Content-Type: text/html Content-Transfer-Encoding: 7bit <html> <head> <title>Title of page</title> </head> <body> This is my first homepage. <b>This text is bold</b> </body> </html> I need to use the standard UNIX command : sendmail or mutt or mailx... Any help would be greatly appreciated... asap please ;-) Stefan. |
|
||||
|
try this
echo "From: $LOGNAME\nTo: $MAILTO\nSubject: $SUBJECT\n" > ${Mail_File}
echo "${Email Body}\n Regards,\n$LOGNAME" >> ${Mail_File} uuencode ${FileToSend} "Error Log.txt" >> ${Mail_File} /usr/lib/sendmail -t -oi < ${Mail_File} first echo will assign, TO,Subject and From in the email header Second echo would create the body of the email. last uuencode would attach the file to the email ${FileToSend} is the file you want to attach and "Error Log.txt" is the file name that would be dispalyed in the attachement Fianlly sendmail will send the email with body and specified attachment. --Manish Jha |
![]() |
| Bookmarks |
| Tags |
| mailx, mailx attachment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|