Making a formatted distribution list

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
$var
Forum Contributor
Posts: 317
Joined: Thu Aug 18, 2005 8:30 pm
Location: Toronto

Making a formatted distribution list

Post 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);
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post 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!
Post Reply