Reputation: 79
I am using mail function to send mail via php script to gmail. Here is the code :
if( mail($to,$subject,$message,$headers))
echo "mail sent";
else
echo "mail not sent";
Every time it echos "mail not sent". It fails for gmail but works for other servers.
Any idea why so? Thanks.
Upvotes: 0
Views: 239
Reputation: 41
You should start with checking the SMTP configration(SMTP stands for simple mail transfer protocol). You can find it in the php.ini; look for the line that reads [mail function]
Upvotes: 2