tags:

views:

1883

answers:

3

Anyone has a demo available?

Sendmail is said to be not scalable,but it's free,so I decided to use it first for now:)

+2  A: 

This page should help - http://www.zedwood.com/article/103/bash-send-mail-with-an-attachment

It includes a script to send e-mail with a MIME attachment, ie with a HTML page and images included.

DavidMWilliams
Not the same thing as the author questioned for, but probably still helpful.
ypnos
+3  A: 

If I understand you correctly, you want to send mail in HTML format using linux sendmail command. This code is working on Unix. Please give it a try.

(
echo "From: [email protected] "
echo "To: [email protected] "
echo "MIME-Version: 1.0"
echo "Content-Type: multipart/alternative; " 
echo ' boundary="PAA08673.1018277622/server.xyz.com"' 
echo "Subject: Test HTML e-mail." 
echo "" 
echo "This is a MIME-encapsulated message" 
echo "" 
echo "--PAA08673.1018277622/server.xyz.com" 
echo "Content-Type: text/html" 
echo "" 
echo "<html> 
<head>
<title>HTML E-mail</title>
</head>
<body>
<a href='http://www.google.com'&gt;Click Here</a>
</body>
</html>"
echo "--PAA08673.1018277622/server.xyz.com"
) | sendmail -t

For the sendmail configuration details, please refer to this link. Hope this helps.

Space
If the content of email is pre-generated and restored in a file called content.html,how to send it to B from A with sendmail?
Shore
if you want to read the contents from an external file you can use some bash script to read lines from external html file and put in at data field of the email OR just simply copy paste the html code. Also, please have a look to link given by virus. Hope this helps.
Space
The only part I'm not clear about is :boundary="PAA08673.1018277622/server.xyz.com".What does it mean?
Shore
I've decided to read an entire book about sendmail,there is no ready information on the internet.
Shore
sendmail needs configuration before actually sending out email,right?
Shore
Yes you have configure sendmail before using it. If you still wondering about the details, I have edited my comment with the link which was helpful for me last time.
Space
A: 

A quick google give me this link.

Space