0

I am trying to send email using following PHP code.But I get the following error:

Warning: mail(): SMTP server response: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257

<?php
    $to = "jaynanavati@gmail.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "jaynanavati@gmail.com";
    $headers = "From:" . $from;
    mail($to,$subject,$message,$headers);
    echo "Mail Sent.";
?>
4

1 回答 1

0

很明显,您的 SMTP 服务器要求您进行身份验证。使用更强大的工具来发送邮件,例如 PHPMailer。

于 2013-04-20T07:35:54.537 回答