Gmail'i kullanarak e-posta göndermek için SwiftMailer 4.1.6'ı indirdim. Bu amaçla aşağıdaki kodu yazmıştım. Swift Mailer, GMail ve PHP ile e-posta gönder, İzin Reddedildi Hata
<?php
require_once 'swiftmailer/lib/swift_required.php';
$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, "ssl")
->setUsername('[email protected]')
->setPassword('***********');
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Wonderful Subject')
->setFrom(array('[email protected]' => 'Jomit Jose'))
->setTo(array('[email protected]' => 'Jomit Jose'))
->setBody('This is the text of the mail send by Swift using SMTP transport.');
$numSent = $mailer->send($message);
printf("Sent %d messages\n", $numSent);
ve aşağıdaki hata ile sonuçlandı: olabilirdi ne
Fatal error: Uncaught exception 'Swift_TransportException' with message
'Connection could not be established with host smtp.gmail.com
[Permission denied #13]' in
/home/jomit/public_html/email_test/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:266
Stack trace:
#0 /home/jomit/public_html/email_test/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(66):
Swift_Transport_StreamBuffer->_establishSocketConnection()
#1 /home/jomit/public_html/email_test/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(117):
Swift_Transport_StreamBuffer->initialize(Array)
#2 /home/jomit/public_html/email_test/swiftmailer/lib/classes/Swift/Mailer.php(79):
Swift_Transport_AbstractSmtpTransport->start()
#3 /home/jomit/public_html/email_test/test.php(16):
Swift_Mailer->send(Object(Swift_Message))
#4 {main} thrown in /home/jomit/public_html/email_test/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php on line 266
yanlış?
deneyin portu 443 yerine 465 – maxjackie
@maxjackie Oops kullanarak! Aynı hatayla da sonuçlanır: '' Yakalanma istisnası 'Swift_TransportException' mesajı ile 'Bağlantı host ile oluşturulamadı smtp.gmail.com [İzin reddedildi # 13]' ' – Jomoos
PHP kurulumunuz SSL destekliyor mu? –