hi friends i have this error how to solve

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
r_nagu127
Forum Newbie
Posts: 1
Joined: Sat Jan 26, 2008 5:05 am

hi friends i have this error how to solve

Post by r_nagu127 »

Fatal error: Uncaught exception 'Swift_ConnectionException' with message 'There was a problem reading line 1 of an SMTP response. The response so far was:<br />[]. It appears the connection has died without saying goodbye to us! Too many emails in one go perhaps? (fsockopen: #0) ' in C:\wamp\www\qis\swift_lib\Swift\Connection\SMTP.php:250 Stack trace: #0 C:\wamp\www\qis\swift_lib\Swift.php(306): Swift_Connection_SMTP->read() #1 C:\wamp\www\qis\swift_lib\Swift.php(217): Swift->command('', 220) #2 C:\wamp\www\qis\swift_lib\Swift.php(101): Swift->connect() #3 C:\wamp\www\qis\test_email.php(23): Swift->__construct(Object(Swift_Connection_SMTP)) #4 {main} thrown in C:\wamp\www\qis\swift_lib\Swift\Connection\SMTP.php on line 250

my coding
php

//Load in the files we'll need
require_once "swift_lib/Swift.php";
require_once "swift_lib/Swift/Connection/SMTP.php";

//Start Swift
// //$swift =& new Swift(new Swift_Connection_SMTP("smtp.gmail.com")); 587, SWIFT_TLS
// $smtp = new Swift(new Swift_Connection_SMTP(
// "smtp.gmail.com", Swift_Connection_SMTP::PORT_SECURE, Swift_Connection_SMTP::ENC_TLS));

// $smtp = new Swift(new Swift_Connection_SMTP(
// "smtp.gmail.com",465, SWIFT_TLS));


$smtp =& new Swift_Connection_SMTP("smtp.gmail.com",465, SWIFT_TLS);
//$smtp =& new Swift_Connection_SMTP("localhost",25, SWIFT_TLS);
//$smtp->setUsername("your google user");
//$smtp->setpassword("password");
$smtp->setUsername("rnagu127@gmail.com");
$smtp->setpassword("geetha");

$swift =& new Swift($smtp);
//Create the message
$message =& new Swift_Message("My subject", "My body");

//Now check if Swift actually sends it
if ($swift->send($message, "rnagu127@gmail.com", "r_nagu127@yahoo.com")) echo "Sent";
else echo "Failed";


?>
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: hi friends i have this error how to solve

Post by Chris Corbyn »

Could you turn on the highest logging level please and post the error again (it should include a log dump):

Code: Select all

Swift_LogContainer::getLog()->setLogLevel(4);
I'm assuming you're using version 3.3.2 here...
Post Reply