Jump to content

email sent to Hotmail doesn't appear


elcash_36

Recommended Posts

Hi!

Well, i have a new problem guys and i think this is the best way to solve it.

I have this PHP code, it's very simple, but when i click on SEND it appears "Message sent correctly". Everything is OK. But when i enter HOTMAIL to see the e-mail sent, it doesn't appears. How could be this?

This is the PHP code i'm using:

 

<?php

$Name = $_POST['Name'];

$email = $_POST['email'];

$Company = $_POST['Company'];

$Subject = $_POST['Subject'];

 

$header = 'From: ' . $email . " \r\n";

$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";

$header .= "Mime-Version: 1.0 \r\n";

$header .= "Content-Type: text/plain";

 

$message = "This message was sent by " . $Name . ", from " . $Company . " \r\n";

$message .= "His e-mail is: " . $email . " \r\n";

$message .= "Subject: " . $Subject . " \r\n";

$message .= "Message: " . $_POST['message'] . " \r\n";

$message .= "Sent: " . date('d/m/Y', time());

 

$for = '[email protected]';

$subject =  "Subject";

 

if (mail($for, $subject, $message, $header)) {

  echo("<p>Message sent correctly!</p>");

} else {

  echo("<p>¡ERROR! Message not sent...</p>");

}

?>

Link to comment
https://forums.phpfreaks.com/topic/190642-email-sent-to-hotmail-doesnt-appear/
Share on other sites

This is not unusual. Hotmail is a big issue to send mail to, and this is unlikely to be a PHP issue.

 

What may help is setting up SPF records for your server, but that is way off-topic for this board.

 

If you can send mail to other addresses then this is not a PHP issue.

The From: address must be a valid email address at the sending mail server or there must be an SPF record at the domain being used in the From: address that indicates that your sending mail server is authorized to send email for that domain.

 

Would you trust an important letter that has a From: address that says it is coming from one location but the post mark says it came from somewhere else?

I've just posted a topic on a very similar issue. I found hotmail only has issues when you introduce headers. I'm trying to send html email, so this is an issue for me. But if you want to send just plain php mail, perhaps simply bypass the headers altogether(? - I'm aware that people are about to shoot me down about lack of standards & all that jazz, but it does fix a problem so you have to weigh the pros against the cons)

 

Hope that helps :)

Archived

This topic is now archived and is closed to further replies.

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