mercredi 28 mai 2014

Mail funcition on Live Server is Not sending Mails


Vote count:

0




I have a website and have enabled to send mail using the By default mail function of php


My code is this


I have tested it from other posts also.. and for me it is correct.. but it is still not sending the message. Please tell me.. where is the problem



<?php
include_once './config.php';
$con=mysqli_connect(mysql_host,mysql_user,mysql_password,mysql_database);

$Roll = $_REQUEST['UserName'];
ini_set('display_errors',1);
// Check connection
if (mysqli_connect_errno($con))
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
else
{
$confirmCode = md5(uniqid(rand()));

$tbl_name1 = "temp_forgot_acc";
$orderCheck = "DELETE FROM $tbl_name1 WHERE EmailId = '$Roll'";

mysqli_query($con,$orderCheck);

$order = "INSERT INTO $tbl_name1 (EmailId,confirm_code) VALUES ('$Roll','$confirmCode')";

$result = mysqli_query($con,$order);
//if($result)
// {
// ---------------- SEND MAIL FORM ----------------

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

// Your subject
$subject="Your Forgot Pass link here";

// From
$header = 'From: Admin <admin@test.com>' . "\r\n";

// Your message
$message="Your Comfirmation link \r\n";
$message.="http://ift.tt/1piCIDG";

// send email
mail($to,$subject,$message,$header);
// }
echo '{"data":[';
echo "{" . '"Finish":'.'"YES"}';

echo ']}';
}
mysqli_close($con);
exit();
?>


I am able to insert it in the database... but it is not sending the maill... please help me !!



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire