Page 1 of 1

authenticating troubles

Posted: Mon Feb 25, 2008 2:20 am
by ricnut
I'm using the latest swiftmail.
I had it doing all kinds of cool stuff on hostgator.com server, but then the fun came to a hault.
I can no longer send emails out to place like hotmail and lycos mail.
When I setup outlook they required I check "my server requires authentification" the settings are the same as my incoming settings, and they require you use port 26 instead of 25.
this is all working fine.

<?php


require_once "lib/EasySwift.php";
require_once "lib/Swift/Connection/SMTP.php";
require_once 'lib/Swift/Authenticator/PopB4Smtp.php';

$smtp->attachAuthenticator(new Swift_Authenticator_PopB4Smtp("pop.shasheenmachine.com"));
$smtp->setUsername("me@shasheenmachine.com");
$smtp->setPassword("me_password");



$swift =& new Swift(new Swift_Connection_SMTP("mail.shasheenmachine.com"));



it's parcing the scripts for sure. here is my error:

Fatal error: Call to a member function on a non-object in /home/me/public_html/checkout.php on line 8


line 8 being - $smtp->attachAuthenticator(new Swift_Authenticator_PopB4Smtp("pop.shasheenmachine.com")); I've changed this to mail.shasheenmachine.com and I've tried changing the username to my account username instead of email address. I don't have any more ideas.

I need this to work because my form sends a sales reciept to clients outside the hostgator realm.

Re: authenticating troubles

Posted: Mon Feb 25, 2008 2:37 am
by Chris Corbyn
Where did $smtp appear from?

Code: Select all

<?php
 
 
require_once "lib/EasySwift.php";
require_once "lib/Swift/Connection/SMTP.php";
require_once 'lib/Swift/Authenticator/PopB4Smtp.php';
 
$smtp =& new Swift_Connection_SMTP("mail.shasheenmachine.com");
$smtp->attachAuthenticator(new Swift_Authenticator_PopB4Smtp("pop.shasheenmachine.com"));
$smtp->setUsername("me@shasheenmachine.com");
$smtp->setPassword("me_password");
 
$swift =& new Swift($smtp);
;)

If you're not using EasySwift don't include it (in fact, don't use it anyway :P). If you're not using PHP4 the ampersands don't need to be there neither.

Re: authenticating troubles

Posted: Mon Feb 25, 2008 3:10 am
by ricnut
Same message is returning. I recently recieved a lobotomy so I'm going to need you again.

Re: authenticating troubles

Posted: Mon Feb 25, 2008 6:16 am
by Chris Corbyn
You're getting that same error with the code I posted? :?
Fatal error: Call to a member function on a non-object in /home/me/public_html/checkout.php on line 8
Post what you've done please, it's not possible to get that error if you've read my code properly, otherwise it's a different error or you've not changed your code accordingly. Note that I *created* the $smtp variable in my version; your version was never creating it.

Re: authenticating troubles

Posted: Mon Feb 25, 2008 3:53 pm
by ricnut
Sorry I missed the variable. I recieved a bunch of new errors

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/ricnut/public_html/ricnut/lib/Swift/Authenticator/PopB4Smtp/Pop3Connection.php on line 129

Warning: fsockopen() [function.fsockopen]: unable to connect to pop.shasheenmachine.com:110 in /home/ricnut/public_html/ricnut/lib/Swift/Authenticator/PopB4Smtp/Pop3Connection.php on line 129

Fatal error:
Uncaught Error of type [swift_connectionexception] with message [The POP3 connection failed to start. The error string returned from fsockopen() is [Success] #0]
@0 swift::swift() in /home/ricnut/public_html/ricnut/checkout.php on line 12
@1 swift::connect() in /home/ricnut/public_html/ricnut/lib/Swift.php on line 109
@2 swift::handshake() in /home/ricnut/public_html/ricnut/lib/Swift.php on line 230
@3 swift_connection_smtp::postconnect() in /home/ricnut/public_html/ricnut/lib/Swift.php on line 286

in /home/ricnut/public_html/ricnut/lib/Swift/Errors.php on line 99

below is my checkout.php file line 12

Code: Select all

 
require_once "lib/EasySwift.php";
require_once "lib/Swift/Connection/SMTP.php";
require_once 'lib/Swift/Authenticator/@PopB4Smtp.php';
 
$smtp =& new Swift_Connection_SMTP("mail.shasheenmachine.com");
$smtp->attachAuthenticator(new Swift_Authenticator_PopB4Smtp("pop.shasheenmachine.com"));
$smtp->setUsername("me@shasheenmachine.com"); 
$smtp->setPassword("me_PASSWORD"); 
 
 
$swift =& new Swift($smtp);
 
 

Re: authenticating troubles

Posted: Mon Feb 25, 2008 5:18 pm
by EverLearning
From what I can tell from errors you posted, it seems that the host your're trying to connect to isn't available at the moment. Check to see that your settings are right.

Re: authenticating troubles

Posted: Mon Feb 25, 2008 11:42 pm
by Chris Corbyn
EverLearning wrote:From what I can tell from errors you posted, it seems that the host your're trying to connect to isn't available at the moment. Check to see that your settings are right.
Indeed. PHP's fsockopen() function is throwing the error ;)