news letter
Posted: Fri Jan 18, 2008 2:55 am
hi , i wanted to implement newsletter , can anybody guide me through it...
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
someone@domain.com
someone_else@other_domain.com
blah@somesite.comCode: Select all
<?php
$receivers = file_get_contents('recipients.html');//get the emails
$newsletter = file_get_contents('newsletter.html');//get the newsletter to send
$receivers = explode('
', $receivers);//break up receivers into array
$headers = 'MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1';//make email HTML
foreach ($receivers as $receiver){//run through each receiver,
if (mail($receiver, 'the subject of the newsletter', $newsletter, $headers){
echo 'Email sent to '. $receiver .'<br />';
}else{
echo 'Not sent to '. $receiver .'<br />';
}
}