I am a newbie in PHP, so all i know is actually from the forums. These are the settings i made in my php.ini file
SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = engr.atiq19@gmail.com
sendmail_path = "\"C:\xamppnew\sendmail\sendmail.exe\" -t"
;sendmail_path = "C:\xamppnew\mailtodisk\mailtodisk.exe"
These are the changes made in sendmail.ini file
smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=engr.atiq19@gmail.com
auth_password=************
force_sender=engr.atiq19@gmail.com
And here is the code I am using to send the mail
$to = "engr.atiq19@gmail.com";
$myemail = "engr.atiq19@gmail.com";
$email_subject = "Contact form submission: $name";
$email_body = "my message";
$headers = "From: $myemail
";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
header('Location: ../index-alt2.html?t="done successfully"');