Jump to content

mail function (newwwbie)


christophe

Recommended Posts

Hi there

 

I have written this code to email all the email addresses i have in my database. The content of the email also comes from a row called content

 


/Set mail variables
$subject ="Retention Mailing List";
$headers  = "Content-Type: text/html; charset=iso-8859-1\n";
$headers .= "From: Retention U.K Ltd <Address>\n";
$headers .= "Reply-to: Retention U.K Ltd <address>\n";




//Query db
$query = "SELECT email, content FROM mailinglist";      
$result = mysql_query($query) or die(mysql_error());

//fetch mysql array
while($row = mysql_fetch_array($result)){
    echo $row['email'];
    echo $row['content'];
    echo "<br />";
     
   
//send mail
mail($row[email], $subject, $row[content], $headers);

}

mysql_free_result($result);

 

It looks as tough everytime an email gets sent the email client (outlook, hotmail, thunderbird) see's them as spam

 

Can anyone help me please ( im a bit of a noobie aswell so apologies if this makes no sense atall)?

 

Thanks

Alex

Link to comment
https://forums.phpfreaks.com/topic/48651-mail-function-newwwbie/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.