Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use pear mail mime
    primarykey
    data
    text
    <p>How can you use pear mail mime with google. I found this which lets you use pear mail with google, but not mail mime: <a href="http://globalconstant.scnay.com/2009/11/06/sending-email-through-gmail-using-php/" rel="nofollow">http://globalconstant.scnay.com/2009/11/06/sending-email-through-gmail-using-php/</a></p> <pre><code>require_once "Mail.php"; require_once "Mail/mime.php"; $from = "Sender &lt;*******@googlemail.com&gt;"; $to = "Receiver &lt;*******@googlemail.com&gt;"; $subject = "Welcome to SITENAME!"; $crlf = "\n"; $html = "&lt;h1&gt; This is HTML &lt;/h1&gt;"; $headers = array('From' =&gt; $from, 'To' =&gt; $to, 'Subject' =&gt; $subject); $host = "smtp.gmail.com"; $port = 465; $username = "********@googlemail.com"; $password = "********"; $mime = new Mail_mime($crlf); $mime-&gt;setHTMLBody($html); $body = $mime-&gt;get(); $headers = $mime-&gt;headers($headers); $smtp = Mail::factory("smtp",array("host" =&gt; $host, "port" =&gt; $port, "auth" =&gt; true, "username" =&gt; $username, "password" =&gt; $password)); $mail = $smtp-&gt;send($to, $headers, $body); if (PEAR::isError($mail)) { echo $mail-&gt;getMessage(); } else { echo "Message sent successfully!"; } echo "\n"; </code></pre> <p>I keep getting </p> <blockquote> <p>Failed to add recipient: @localhost [SMTP: Invalid response code received from server (code: 555, response: 5.5.2 Syntax error. f52sm5542930wes.35)]</p> </blockquote> <p><strong>Edit:</strong></p> <p>The email is now received, however it turns out like this:</p> <pre><code>This is a message I sent from &lt;a href=3D"http://www.php.net/"&gt;PHP&lt;/a&gt; using= the PEAR Mail package and SMTP through Gmail. Enjoy! </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload