Page 1 of 1

V3 Authentication Issue, Swift_Authenticator_PLAIN

Posted: Wed Oct 28, 2009 9:25 am
by IgotDreams
I have an issue, I am getting this error;

Fatal error: Call to undefined method: swift_connection_smtp->attachauthenticator()

Here is my code, as the host has instructed to "Please try to use PLAIN smtp authentication type in swiftmailer."

Code: Select all

 
require('Swift/Swift.php');
require('Swift/Swift/Connection/SMTP.php');
require('Swift/Swift/Authenticator/PLAIN.php');
 
$smtp = new Swift_Connection_SMTP($MailServ); 
$smtp->attachAuthenticator(new Swift_Authenticator_PLAIN());
$MailProc =& new Swift($smtp);
if ($MailProc->isConnected()){
    if ($MailProc->authenticate($MailUser, $MailPass)){
        $MailProc->send($MailDest, $MailFrom, $MailSubj, $MailBody);
        print '<p align="center"><strong>Thank You!</strong></p><p align="center">We have received your request<br />and will be contacting you shortly.</p>';
    }else{
        print '<p class="Content">This form failed to <strong>AUTHENTICATE</strong> to the mail server, please call us at '.$MailCall.'!</p>';
    }
    //Closes cleanly
    $MailProc->close();
}else{
    print '<p>This form failed to <strong>CONNECT</strong> to the mail server which is needed to send your mail. Please call us at '.$MailCall.'!</p>';
}
 
Thanks for the help.