Armut posta mim nasıl kullanılır

0 Cevap php

Nasıl google ile armut posta mim kullanabilirsiniz. http://globalconstant.scnay.com/2009/11/06/sending-email-through-gmail-using-php/: Ben google ile armut posta kullanımı, ama mim değil posta olanak sağlayan bu bulundu

require_once "Mail.php";
require_once "Mail/mime.php";

$from = "Sender <*******@googlemail.com>";
$to = "Receiver <*******@googlemail.com>";
$subject = "Welcome to SITENAME!";
$crlf = "\n";
$html = "<h1> This is HTML </h1>";

$headers = array('From' => $from,
                 'To' => $to,
                 'Subject' => $subject);


$host = "smtp.gmail.com";
$port = 465;
$username = "********@googlemail.com";
$password = "********";

$mime = new Mail_mime($crlf);
$mime->setHTMLBody($html);

$body = $mime->get();
$headers = $mime->headers($headers);

$smtp = Mail::factory("smtp",array("host" => $host,
                      "port" => $port,
                      "auth" => true,
                      "username" => $username,
                      "password" => $password));

$mail = $smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
echo $mail->getMessage();
} else {
echo "Message sent successfully!";
}
echo "\n";

Ben almaya devam

Failed to add recipient: @localhost [SMTP: Invalid response code received from server (code: 555, response: 5.5.2 Syntax error. f52sm5542930wes.35)]

Edit:

E-posta şimdi ancak böyle çıkıyor, alınır:

This is a message I sent from <a href=3D"http://www.php.net/">PHP</a> using=
 the PEAR Mail package and SMTP through Gmail. Enjoy!

0 Cevap