0

Here's my code:

<?php

$to = 'test@hotmail.com';
$subject = 'reservation hotel n';
$msg ='ok';

// Make sure to escape quotes

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= 'From:  hôtel  <reservation@hotel.com' . "\r\n";

mail($to, $subject, $msg, $headers);

?>

It worked for Gmail, Yahoo, GMX ...but it didn't work for Hotmail/Live/MSN.

Because it worked for Gmail, I can assume that it has nothing to do with my server, right?

I also tried it with just: http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/Default.aspx

System Maintenance in progress. Please try again later.

think's for help

animuson
  • 53,861
  • 28
  • 137
  • 147
Dotcomtunisia
  • 123
  • 1
  • 9
  • See : http://stackoverflow.com/questions/22433687/how-to-format-an-email-that-hotmail-outlook-is-happy-with – Mr.Quack Oct 20 '14 at 11:40
  • Hotmail/Microsoft are very rigid when it comes to accepting emails – they pay very close attention to certain headers being set/their values, sender and location (server) “matching”, etc. See other questions with similar topics to try and find a solution, http://stackoverflow.com/search?q=php+mail+hotmail – CBroe Oct 20 '14 at 11:42
  • There's a whole bunch of server configuration you're gonna need to do to make your server reliable for emailing. Most people nowadays use third party services like Amazon because they have everything set up and you can be sure your emails aren't going to be picked up as spam. Nothing wrong with your code – danhardman Oct 20 '14 at 11:42

3 Answers3

0

I think that you need one of these for it to work: Sender ID Framework SPF Record Wizard

It should solve your problem as Hotmail wants this for safety.

animuson
  • 53,861
  • 28
  • 137
  • 147
0
Check it

<?php
   $to = "$email";
    $subject = "Welcome to";
    $message = " Hi $username,<br /><br />
    Thank you for signing up with us.<br />

    Thanks <br />";
    // Always set content-type when sending HTML email
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
    // More headers
    $headers .= 'From: <test@gmail.com>' . "\r\n";
    $mail=mail($to,$subject,$message,$headers);
?>
Hara Prasad
  • 704
  • 6
  • 15
0

problem solved i change with php mailer

require_once "class.phpmailer.php"; 
require_once "class.smtp.php"; 



$mail->Host       = "smtp.gmail.com";  
$mail->Port       =  587;  
$mail->Username = "**@gmail.com";
$mail->Password = "**";
$mail->From       = "***";  

$mail->FromName   = "Hôtel **";  
$mail->IsHTML(true); // if you are going to send HTML formatted emails
$mail->SingleTo = true; // if you want to send a same email to multiple users. multiple emails will be sent one-by-one.

//Caractéristiques du message  
$mail->CharSet     = 'utf-8';  
$mail->ContentType = 'text/plain';  
$mail->Encoding    = '8bit';  

$mail->Subject    = "**";  
$mail->Body       = "okkk";  
$mail->WordWrap   = 0;  

$mail->AddAddress("**@hotmail.com", "nom");  
$mail->Send();
Dotcomtunisia
  • 123
  • 1
  • 9