![]() |
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 |
| 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 do I extract text only from html file without HTML tag | los111 | UNIX for Dummies Questions & Answers | 4 | 11-28-2007 04:40 AM |
| 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 |
| Send an attachment and html text both in the same mail | stefan.yu | Shell Programming and Scripting | 4 | 10-26-2006 09:46 PM |
| html - text file question | frustrated1 | Shell Programming and Scripting | 5 | 09-21-2005 05:23 AM |
| linking unix generated text file to html page | alexd | Shell Programming and Scripting | 1 | 11-13-2002 12:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
HTML message with attachment (text-file)
Hello:
I've searched de forum but could not find an answer to send an email via sendmail in HTML with an text-file (plain-text) as attachment: My code: export FROM="Me" export MAILTO="mymail" export SUBJECT=$TITULO$bbdd export BODY=$LOG ( echo "FROM:$FROM" echo "To: $MAILTO" echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo "Content-Disposition: inline" cat $BODY ) | /usr/sbin/sendmail $MAILTO How could I include the desired attachment? Thank you very much in advance for your help and sorry if this question has been already posted. Félix |
|
|||||
|
Similar post : http://www.unix.com/aix/36448-comman...ttachment.html
|
|
||||
|
Thanks Ygor but it doesn't work.
I tried out the following: LOG=path/test_1.txt export FROM="Me" export MAILTO="adress@blablabla.com" export SUBJECT="Test" export BODY=$LOG export ATTACH="path/test.txt" ( echo "To: $MAILTO" echo "Subject: $SUBJECT" echo "MIME-Version: 1.0" echo 'Content-Type: multipart/mixed; boundary="-q1w2e3r4t5"' echo echo '---q1w2e3r4t5' echo "Content-Type: text/html" echo "Content-Disposition: inline" cat $BODY echo '---q1w2e3r4t5' echo 'Content-Type: application; name="'$(basename $ATTACH)'"' echo "Content-Transfer-Encoding: base64" echo 'Content-Disposition: attachment; filename="'$(basename $ATTACH)'"' uuencode -m $ATTACH $(basename $ATTACH) echo '---q1w2e3r4t5--' ) | /usr/sbin/sendmail $MAILTO It doesn't attach the file but inlcudes it in the mail. It isn't necesary for me to include the file in binary. Any hint? Thank you. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|