Page 1 of 1

Php email

Posted: Fri Oct 07, 2011 1:44 pm
by ebgames56
My PHP emails are being sent into Junk folders. anyone know why

Re: Php email

Posted: Fri Oct 07, 2011 2:02 pm
by Zephni
If you only have a couple of words in your content, or a one worder like "test" as your subject it may show up as SPAM. Check that isn't the case first

Re: Php email

Posted: Fri Oct 07, 2011 2:10 pm
by ebgames56
still posted in junk

Re: Php email

Posted: Fri Oct 07, 2011 2:13 pm
by Zephni
Maybe fill out necessary headers, something like this:

Code: Select all

 $headers = "From: \"".$from_name."\" <".$from_email.">\n"; 
$headers .= "To: \"".$to_name."\" <".$to_email.">\n"; 
$headers .= "Return-Path: <".$from_email.">\n"; 
$headers .= "MIME-Version: 1.0\n"; 
$headers .= "Content-Type: text/HTML; charset=ISO-8859-1\n";
Then pass it through. Are you using PHPMailer or are you just using the mail() function?

Re: Php email

Posted: Fri Oct 07, 2011 2:16 pm
by ebgames56

Code: Select all

$result = mysql_query($query) or die(mysql_error());
	while($row = mysql_fetch_array($result)){
		$to = $row['email'];

		$subject = 'Szeryk Newsletter - Vol: \r\n' . $vol;
		
		$headers = "From: noreply@szeryk.com\r\n";
		$headers .= "MIME-Version: 1.0\r\n";
		$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
		
		$message = "<html>
this is what i have

Re: Php email

Posted: Fri Oct 07, 2011 2:22 pm
by Zephni
One question, why do you set the headers within the while loop, you are redefining the variables each time. Not that it has anything to do with it.

Try this link: http://www.transio.com/content/how-pass ... s-php-mail