Php Mail Sending Failure

Status
Not open for further replies.

machiowilliam85

New Member
Messages
1
Reaction score
0
Points
0
The php mail function is not sending email to users who are request password to log into my website private section. Here is part of my code:

// value sent from form
$email_to=$_POST['email_to'];

// send e-mail to ...
$to=$email_to;

// Your subject
$subject="Your account password";

// From
$header="From: My Name <my x10 hosting email I created from cpanel>";

// My message
$messages= "My password for login to my website \r\n";
$messages.="My password is $your_password \r\n";
$messages.="more message... \r\n";

// send email
$sentmail = mail($to,$subject,$messages,$header);

// if your email succesfully sent
if($sentmail){
echo "Your Password Has Been Sent To Your Email Address.";
}
else {
echo "Cannot send password to your e-mail address";
}

Your help is highly appreciated.

Regards,
William.
 
Status
Not open for further replies.
Top