PHP HTML email, that doesn't go in Hotmail/Yahoo Junk?

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
totw
Forum Newbie
Posts: 2
Joined: Tue Oct 30, 2007 6:56 am

PHP HTML email, that doesn't go in Hotmail/Yahoo Junk?

Post by totw »

Hi

I was wondering if anyone could let me know if its possible to send HTML emails in PHP thats aren't recognised as Junk by Windows Live Hotmail/Yahoo.

Thanks in advance.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

It's certainly possible. If you use something that sends email that conforms to the RFC specifications for email (eg SwiftMailer), and your content doesn't meet their criteria for spam filtering then it'll be ok. It's a bit tricky though because what they consider to be spam changes quite often.

Alternatively you can pay to be on a whitelist but that's really expensive.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Although if it is possible, it must be difficult to do. After all, if it was easy to avoid, you would get the spammers avoiding it to.
totw
Forum Newbie
Posts: 2
Joined: Tue Oct 30, 2007 6:56 am

Post by totw »

I looked at the email headers and I think the problem is that its coming from apache@localhost: Received: (from apache@localhost)

Does anyone know how to change this to the websites actual domain?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Post by aceconcepts »

Although it is a rather crude method for sending emails from a script it works for me a goes directly to the inbox of Hotmail. I haven't tried it with Yahoo though.

Code: Select all

$to = $destination;
$subject = "Please hotmail...please";
$message="<html style=\"height:100%;\"><body style=\"height:100%; margin:0; padding:0;\">";
$message.= $emailMsg;
$message.="</body></html>";
$from = "some_address@some_domain.com";


$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "From: " . $from . "\r\n";
		

//SEND MAIL
	$mailsent=mail($to,$subject,$message,$headers,"-f $from");
I hope it works for you too.
Post Reply