hi
newbie here,
tried to send a form with this tutorial with a gmail smtp connection.
http://www.swiftmailer.org/wikidocs/v3/ ... /form2mail
gmail connection bit
$swift = new Swift(new Swift_Connection_SMTP("smtp.gmail.com", Swift_Connection_SMTP::PORT_SECURE, Swift_Connection_SMTP::ENC_TLS));
$smtp =& new Swift_Connection_SMTP("smtp.gmail.com", 465);
$smtp->setUsername("itsme@gmail.com");
$smtp->setpassword("password");
$swift =& new Swift($smtp);
error_reporting(E_ALL); ini_set('display_errors', true);
trows this error.
please help.
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 /var/www/vhosts/huvema.nl/httpdocs/Swiftmail/lib/Swift/Connection/SMTP.php:250 Stack trace: #0 /var/www/vhosts/huvema.nl/httpdocs/Swiftmail/lib/Swift.php(306): Swift_Connection_SMTP->read() #1 /var/www/vhosts/huvema.nl/httpdocs/Swiftmail/lib/Swift.php(217): Swift->command('', 220) #2 /var/www/vhosts/huvema.nl/httpdocs/Swiftmail/lib/Swift.php(101): Swift->connect() #3 /var/www/vhosts/huvema.nl/httpdocs/request-invoice/handle_form.php(67): Swift->__construct(Object(Swift_Connection_SMTP)) #4 {main} thrown in /var/www/vhosts/huvema.nl/httpdocs/Swiftmail/lib/Swift/Connection/SMTP.php on line 250
fatal error gmail connection
Moderators: Chris Corbyn, General Moderators
-
gmorehoudh
- Forum Commoner
- Posts: 50
- Joined: Tue Mar 04, 2008 1:49 pm
Re: fatal error gmail connection
First, it looks like you're creating the swift object twice, on the first line and then on the last line, so your code may not be doing what you think.
Second, I just tried telnetting to smtp.gmail.com port 465 and it didn't answer. Double check your code and also that you have the server parameters correct.
Second, I just tried telnetting to smtp.gmail.com port 465 and it didn't answer. Double check your code and also that you have the server parameters correct.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: fatal error gmail connection
This is more than likely going to be due to a firewall issue. smtp.gmail.com does respond on port 465:
Is it possible that your web host are blocking the connection?
Code: Select all
chrisbook:flippa chris$ telnet smtp.gmail.com 465
Trying 72.14.253.109...
Connected to gmail-smtp-msa.l.google.com.-
gmorehoudh
- Forum Commoner
- Posts: 50
- Joined: Tue Mar 04, 2008 1:49 pm
Re: fatal error gmail connection
How weird, I can connect fine from my VPS but not from work. We must have it firewalled for spam control or something. Ignore my earlier post!