Page 1 of 1

Making a formatted distribution list

Posted: Wed Dec 20, 2006 11:01 am
by $var
Hello,

I would like to stop using a 3-rd party e-mail distribution list, and I am snooping around for some options.
I have created this e-mail script that runs fine for text emails, however, I was wondering if I could spruce it up with some CSS formatting.
When I do it, it spits it out as <div class=\"Title"\>Regular Looking Text</div>... basically, reading the tags as text.

How would I go about giving it some style... I would like to add an image or two as well.
is this is even possible?

Code: Select all

$mail_body = " 
To Whom It may Concern,

 This is an email.
 
Thank you!	";

$address = 'mbent@domain.com';

$subject = "RE: This is an E-mail Subject (Test)";

$headers = 'From: mbent@domain.com' . "\r\n" .
		   'Reply-To: mbent@domain.com' . "\r\n" .
		   'CC: hendrix@domain.com' . "\r\n" .
		   'X-Mailer: PHP/' . phpversion();
mail($address, $subject, $mail_body, $headers);

Posted: Wed Dec 20, 2006 11:04 am
by John Cartwright
You may find sending and formatting emails properly with mail() alone is very dificult. I personally would recommend you take a look at SwiftMailer, which has it's own forum here, or visit swiftmailer.org. It makes sending emails, even html emails a breeze!