Php email

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ebgames56
Forum Contributor
Posts: 103
Joined: Thu Oct 06, 2011 10:43 am

Php email

Post by ebgames56 »

My PHP emails are being sent into Junk folders. anyone know why
Zephni
Forum Newbie
Posts: 8
Joined: Fri Oct 07, 2011 1:59 pm

Re: Php email

Post 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
ebgames56
Forum Contributor
Posts: 103
Joined: Thu Oct 06, 2011 10:43 am

Re: Php email

Post by ebgames56 »

still posted in junk
Zephni
Forum Newbie
Posts: 8
Joined: Fri Oct 07, 2011 1:59 pm

Re: Php email

Post 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?
ebgames56
Forum Contributor
Posts: 103
Joined: Thu Oct 06, 2011 10:43 am

Re: Php email

Post 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
Zephni
Forum Newbie
Posts: 8
Joined: Fri Oct 07, 2011 1:59 pm

Re: Php email

Post 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
Post Reply