UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 19th, 2010, 12:00 AM
bh_hensem bh_hensem is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 62 bh_hensem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 45 m 24 sec
Reputation Power: 8
Sendmail with attachment command line ?

hi..

Could somebody guide me how to send mail with attachment using sendmail command in unix ?

Thank you,

Reply With Quote
  #2  
Old May 19th, 2010, 09:40 AM
pdreyer pdreyer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2007
Posts: 160 pdreyer User rank is Private First Class (20 - 50 Reputation Level)pdreyer User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 5 h 9 m 55 sec
Reputation Power: 6
Code:
mailx -s 'mail with attachement' pd@pd.com <<EOF
Find attached the hosts and group files

Regards
pd
$(unix2dos /etc/group | uuencode group.txt)
$(unix2dos /etc/hosts |uuencode hosts.txt)
EOF

Reply With Quote
  #3  
Old December 9th, 2010, 04:05 AM
bh_hensem bh_hensem is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2005
Posts: 62 bh_hensem User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 45 m 24 sec
Reputation Power: 8
Hi..

Thank for your reply..

Actually, i can sent the email right now with HTML formatted. But, i do not know how to sent the attachment file from my code. My code as below:-

Code:
To: "BAHARIN HASAN"<baharin.hasan@gmail.com>
from: "DATAONE SDN BHD"<admin@dataone.asia>
Subject: test
Content-Type: text/html
charset="us-ascii"

<html>
<head>
<title>Your Page Title</title>
</head>

<body>
<center>
<table border=0>
  <tr>
    <th><img border=0 src=/images/pulpit.jpg alt=Pulpit rock width=67 height=92 /></th>
    <th><p>&nbsp;</p><h2>Bill Statement</h2></th>
  </tr>

  <tr>
  <td><h4>Dear <ASMAH_AHMAD>,</h4>
  <p>Thank you for your valued subscription to our<br/>
     services.Your TM bill statement is now attached as <br/>
     an Adobe PDF file in this email.</p>
  <p>Thank You</p></td>
  <td><p>Account No.</p><p><12345></p>Statement Date.<p><12/12/2010></p></td>
  </tr>
</table>
<center><img src=example.jpg alt=example/></center>
</center>
</body>
</html>


I am used "sendmail" command and sample command as below:
Code:
cat file.txt |sendmail -t


Thank you,

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Sendmail with attachment command line ?

Developer Shed Advertisers and Affiliates



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap