Hi. I am facing almost the same problem as sandy.beach
I took the code that bdistler posted here and I replaced the fields with my email address in x10hosting and the destination address (gmail) and I am not receiving any email (even though it says "message sent". I have tried with different email accounts and I have the same issue. Is there something wrong with my code? is there something wrong on the server side?
I would appreciate any help.
Thanks beforehand.
PD: I did create an email account in the CPanel
I took the code that bdistler posted here and I replaced the fields with my email address in x10hosting and the destination address (gmail) and I am not receiving any email (even though it says "message sent". I have tried with different email accounts and I have the same issue. Is there something wrong with my code? is there something wrong on the server side?
I would appreciate any help.
Thanks beforehand.
PD: I did create an email account in the CPanel
PHP:
<?php
// added this next line
error_reporting(E_ALL);
$boundary=md5(uniqid(rand()));
//$header .= "From:Name<david.beach@sandybeachit.x10.mx>\n";
//$header .= "Reply-To:Name <david.beach@sandybeachit.x10.mx> \n";
// replaced [ .= ] with [ = ] in this next line
$header = "From:Name<admin@projectx.x10.mx>\n";
$header .= "Reply-To:Name <admin@projectx.x10.mx> \n";
$header .= 'MIME-Version: 1.0'."\r\n";
$header .= "Content-type: multipart/alternative;boundary=$boundary\n";
//$adres = "sandy.beach.it@gmail.com";
$adres = "lobotk50@gmail.com";
$subject = "subject";
$message = "This is multipart message using MIME\n";
$message .= "--" . $boundary . "\n";
$message .= "Content-type: text/plain;charset=iso-8859-1\n";
$message .= "Content-Transfer-Encoding: 7bit". "\n\n";
$message .= "Plain text version\n\n";
$message .="--" . $boundary . "\n";
$message .="Content-type: text/html;charset=iso-8859-1\n";
$message .= "Content-Transfer-Encoding: 7bit". "\n\n";
$message .="<html>
<body>
<center>
<b>HTML text version</b>
</center>
</body>
</html>\n\n";
$message .= "--" . $boundary . "--";
if(mail($adres, $subject, $message, $header))
{
print'message sent';
}
else
{
print'message was not sent';
}
?>