1

it was 3 days i have the same problem, the email successfully sent, but i don't see any message, i use xampp localhost setting like this in sendmail.ini :

[sendmail]

smtp_server = smtp.gmail.com
smtp_port = 587
error_logfile = error.log
debug_logfile = debug.log
auth_username = xxx@gmail.com
auth_password = xxx
force_sender = xxx@gmail.com

and in php.ini, i change this :

extension=php_openssl.dll

[mail function]

SMTP=smtp.gmail.com

smtp_port=587

sendmail_from = xxx@gmail.com

sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"

am i doing something wrong ?, this my php code :

<?php
$name=$_POST['name'];
$email=$_POST['email'];
$subject=$_POST['subject'];
$message=$_POST['message'];

$to=$email;

$message="From:$name <br />".$message;

$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";

$headers .= 'From: ashry <xxx@gmail.com>'."\r\n" . 'Reply-To: '.$name.' <'.$email.'>'."\r\n";
$headers .= 'Cc: ashry.ramadhan17@gmail.com' . "\r\n";
@mail($to,$subject,$message);
if(@mail)
{
echo "Email sent successfully !!";    
}
?>

thank you for your reply!.

0 Answers0