I have tried a lot of solutions from questions on stackoverflow.com and everything looks fine to me, But I still can't send emails
php.ini configuration
sendmail_path = "D:\wamp\sendmail\sendmail.exe -t -i" // i check with both double and single slashes
sendmail_path = "D:\\wamp\\sendmail\\sendmail.exe -t -i"
SMTP = localhost
smtp_port = 25 // tried with 465 port as well
php code
$headers = 'MIME-Version: 1.0' . '\r\n';
$headers .= 'Content-type: text/html; charset=iso-8859-1' . '\r\n';
$headers .= 'From: humaaa@outlook.com' . '\r\n';
$rs = mail('iqra@gmail.com','subject','body message',$headers);
echo ($rs) ? "Success": "Fail";
With PHPMailer tried with phpmailer class as well.
$m = new PHPMailer();
$m->IsSMTP();
$m->Host = "my_domail.com";
$m->Port = "25";
$m->SMTPAuth = false;
$m->Username = 'humaa@my_domail.com';
$m->Username = 'xxxxxxxx';
$m->FromName = 'Huma';
$m->From = 'humaaa@outlook.com';
$m->AddAddress('iqra','iqra@gmail.com');
$m->Subject = 'This is PHPMailer test';
$m->Body = 'This is PHPMailer test here i am going to make you sure!';
$rs = $m->Send();
echo ($rs) ? "Success": "Fail";
I have even tried with swift mailer, but still fail to send. What do I need to do?