PHP Send Mail

Status
Not open for further replies.

proje124

New Member
Messages
2
Reaction score
0
Points
1
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
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';
}
?>
 

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
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?
#1 >
PHP function [ mail() ] returns TRUE if the mail was successfully accepted for delivery by x10hosting's Email server - FALSE otherwise
just because the mail was accepted for delivery it does NOT mean the mail will actually reach the intended destination

outgoing Email is not sent from your account's IP (server) - x10hosting routes all outgoing Email to a Email server that scans the outgoing Emails to ensure no Spam gets out
the Email server will silently discard - HTML Emails - or Emails with spoofed FROM headers - or Emails it 'thinks' are Spam
sometimes the transfer to the Email server fails - you will not receive any notice when it fails
###

#2 >
Today we used that code (PHP script) to test the free-hosting servers here not at x10hosting - to send to gmail and a account I have at GoDaddy
free-hosting servers [ xo1 ] and [ xo2 ] and [ xo3 ] had no issues
free-hosting server [ xo4 ] would send only to its self - the TO and FROM address' were the same - no Email to my Gmail or GoDaddy accounts
 

proje124

New Member
Messages
2
Reaction score
0
Points
1
So maybe my email might be being marked as Spam? How could I prevent this from happening?

Thanks.

PD: I even tried to send an email from my email account using your application "Horde" in the control panel, and it seems the emails are not being sent because I don't see them in the inbox of both hotmail and gmail accounts :(
 

bdistler

Well-Known Member
Prime Account
Messages
3,534
Reaction score
196
Points
63
So maybe my email might be being marked as Spam? How could I prevent this from happening?
which x10hosting's free-hosting server is your account on ? - or what is the domain for your account ?
 
Status
Not open for further replies.
Top