Sending HTML message through PEAR while using SMTP authentication returns an error

前端 未结 4 1819
面向向阳花
面向向阳花 2021-01-13 03:38

I\'m trying to send an HTML message while using SMTP authentication to Gmail in PHP. Here is the script that I am using:

require_once \"Mail.php\";
require_o         


        
4条回答
  •  情歌与酒
    2021-01-13 04:06

    Try embracing the names in double quotes, like so:

    $from = '"Some Name" ';
    $to = '"Other Name" ';
    

    try it and tell us about it.

    Update:
    Ok, above didn't work, so I just would tell you what it's working for me in my php pages to send emails through smtp gmail.

    • I use http://phpmailer.sourceforge.net/
    • smtp server set to smtp.gmail.com
    • it uses TLS protocol in port 587

    so based on that you could try to change your config to:

    $host = "tls://smtp.gmail.com";
    $port = "587";
    

    you can see here how to send mail through gmail with phpmailer.

提交回复
热议问题