1

I tried a bunch of stuff but still i can't send email from my local host!

My php.ini file looks like this:

[mail function]

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = brothersrbin@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"

and my senmail.ini file looks like:

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=brothersrbin@gmail.com
auth_password=my-gmail-password      //my real pass for this email
force_sender=brothersrbin@gmail.com

And my php code looks like :

$to = "poznan.milan@gmail.com";
$subject = "REsttujte vas password";
$message = "This is simple text message.";
$header = "From:brothersrbin@gmail.com \r\n";
$retval = mail($to,$subject,$message,$header);
if( $retval == true )  
{
   echo "Message sent successfully...";
}
else
{
   echo "Message could not be sent...";
}

So can someone help me. What is wrong in here? And can You give to me another solution?

Milan Poznan
  • 307
  • 4
  • 18

0 Answers0