I am trying to send email from localhost XAMPP, I have updated all the required files but still unable to send Email from localhost. Regards: M.Tahseen ur Rehman.
php.ini
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
sendmail.ini
auth_username=myemail@gmail.com auth_password=mypassword
After all these update i have created a PHP file mail.php to send mails but its not delivering any Email.
include 'connect.php';
$subject = $_REQUEST['subject'] ; // Subject of your email
$personal_email= "abc@hotmail.com";
$message .= 'Name: ' . $_REQUEST['name'] . "<br>";
$message .= $_REQUEST['product_type']. "<br>";
$message .= $_REQUEST['message'];
$subject_to_sender= "Confirmation";
$message_to_sender = "Thanks for contacting us";
$name= $_REQUEST['name'];
$email= $_REQUEST['email'];
$message= $_REQUEST['message'];
$product_type= $_REQUEST['product_type'];
$address= $_REQUEST['address'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= "From: " . $_REQUEST['email'] . "\r\n"; // Sender's E-mail
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
if (@mail($email, $subject_to_sender, $message_to_sender, $headers))
{
mail($personal_email, $subject, $message, $headers);
// Transfer the value 'sent' to ajax function for showing success message.
echo 'sent';
}
On Send Button i also send all the Data into Database, and its successfully inserting data into database.
Kindly guide me.