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

前端 未结 4 1828
面向向阳花
面向向阳花 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 03:53

    Figured it out myself finally.

    Thanks to Abid Hussain for providing the link to the example here: http://tonyvirelli.com/slider/php-html-email-using-smtp/

    Solution:

    1. Remove the 'Return-Path' => $from from the headers array.
    2. Add To => $to to the headers array(without this, the to header of the received email is Undisclosed recipients)

提交回复
热议问题