Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.