rushi kulkarni
rushi kulkarni

Reputation: 79

PHP mail function fails to send mail to gmail

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

Answers (1)

user1649351
user1649351

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

Related Questions