Jump to content

PHP mail() and Gmail - Avoiding Spam


SilentQ-noob-

Recommended Posts

Hi,

This is the code I am using to send mail, and it does avoid the spam filter in Gmail, but shows the header info.

<?
$from = $from_name." <".$from_email.">";
ini_set("sendmail_from",$from);
$headers = $from."\n". "Content-Type: text/html; format=flowed\n". "MIME-Version: 1.0\n". "Content-Transfer-Encoding: 8bit\n". "X-Mailer: PHP\n";
mail($to,$subject,$message,$headers);
?>

 

SO the message appears in inbox, it shows the from name and from email, except with this string showing

"Content-Type: text/html; format=flowed\n". "MIME-Version: 1.0\n". "Content-Transfer-Encoding: 8bit\n". "X-Mailer: PHP\n" as well as HTML elements

 

however when I have it like this:

 

<? 
$headers = "From: ".$from_name." <".$fromaddress.">"."\n". "Content-Type: text/html; format=flowed\n". "MIME-Version: 1.0\n". "Content-Transfer-Encoding: 8bit\n". "X-Mailer: PHP\n";
mail($to,$subject,$message,$headers);
?>

 

The message appears in spam folder, BUT the html elements dont show, which is what I want.

 

 

so my question is how do I get the message to appear in the inbox, and not showing the various html tags,

Thanks in advance! silentQ

 

Link to comment
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.