Coder’s Eye

A site about one of the three passions in my life.

Coder’s Eye header image 2

How to send HTML Mail to a Mailing List

June 4th, 2008 · 1 Comment

Many stores use GNU Mailman to maintain a mailing list for store sales and newsletters. Satchmo has this as a built-in option, for example. It isn’t too bad an option, after all. You can easily set options so that it is “push only” and therefore only the mailing list owner can send mail.

(Yes, it really isn’t a great idea. I heartily recommend a service such as Aweber to manage your list, which will lead to much better legal compliance and more professional results. But bear with me, not all store owners want to pay for additional services.)

However, what if you want to send nicely formatted HMTL newsletters? How do you get your mail client to send those so that they’ll look nice for your customers? Answer, you don’t. You send it manually from the commandline.

Here’s how…

Go to the server where you’ve got your store. Hopefully it is linux or similar. I couldn’t care less about how to do this from Windows. Not my bag.

Make a well-formatted email and put it on the server somewhere. In this example, we’ll call it “newsletter.html”

Now copy and modify this for your own needs.


(
echo "From: you@example.com"
echo "To: yourlist@example.com"
echo "MIME-Version: 1.0"
echo "Content-Type: multipart/mixed;"
echo ' boundary="PAA08673.1018277622/example.com"'
echo "Subject: My Newsletter"
echo ""
echo "This is a MIME-encapsulated message"
echo ""
echo "--PAA08673.1018277622/example.com"
echo "Content-Type: text/html"
echo ""
cat newsletter.html
echo ""
echo "--PAA08673.1018277622/example.com"
) | /usr/sbin/sendmail -t

Paste that into your commandline, and you’ll send that HMTL email, formatted “raw”, just the way you want it.

Technorati Tags: , , ,

Tags: Best Practices · Linux

Bookmark this article

del.icio.us:How to send HTML Mail to a Mailing List digg:How to send HTML Mail to a Mailing List spurl:How to send HTML Mail to a Mailing List wists:How to send HTML Mail to a Mailing List simpy:How to send HTML Mail to a Mailing List newsvine:How to send HTML Mail to a Mailing List blinklist:How to send HTML Mail to a Mailing List furl:How to send HTML Mail to a Mailing List reddit:How to send HTML Mail to a Mailing List fark:How to send HTML Mail to a Mailing List blogmarks:How to send HTML Mail to a Mailing List Y!:How to send HTML Mail to a Mailing List smarking:How to send HTML Mail to a Mailing List magnolia:How to send HTML Mail to a Mailing List segnalo:How to send HTML Mail to a Mailing List gifttagging:How to send HTML Mail to a Mailing List

1 response so far ↓

  • 1 som ban // Sep 13, 2008 at 9:27 am

    i love u

Leave a Comment