PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Tue Dec 18, 2018 7:15 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Oct 28, 2009 9:25 am 
Offline
Forum Newbie
User avatar

Joined: Wed Jan 28, 2009 11:03 am
Posts: 3
Location: Orlando, Florida
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."

Syntax: [ Download ] [ Hide ]
 
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group