CRAMMD5, LOGIN, PLAIN, PopB4Smtp and SwiftMailer 4

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
arena
Forum Newbie
Posts: 11
Joined: Tue Jun 05, 2007 5:36 am

CRAMMD5, LOGIN, PLAIN, PopB4Smtp and SwiftMailer 4

Post by arena »

Hello,

first of all, thanks for this wonderful class.

I am currently converting my code using SM3.3 to SM4.

How can i convert the following code :

Code: Select all

case 'CRAMMD5' :
    $conn->attachAuthenticator(new Swift_Authenticator_CRAMMD5());
break;
case 'LOGIN' :
    $conn->attachAuthenticator(new Swift_Authenticator_LOGIN());
break;
case 'PLAIN' :
    $conn->attachAuthenticator(new Swift_Authenticator_PLAIN());
break;
case '@PopB4Smtp' :
    $conn->attachAuthenticator(new Swift_Authenticator_PopB4Smtp($pophost));
break;
Samples welcomed.
Thanks for your replies.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: CRAMMD5, LOGIN, PLAIN, PopB4Smtp and SwiftMailer 4

Post by Chris Corbyn »

For Pop before SMTP there's a plugin (since it's not a real authenticator). For managing CRAMMD5 vs LOGIN vs PLAIN, currently it's done automatically and you have no control over it. I'll re-implement this since I guess it can be useful to drill right down to such a low level of control.

POP Before SMTP:

Code: Select all

$mailer->registerPlugin(new Swift_Plugins_PopBeforeSmtpPlugin('pop.host.tld', 110));
I'll add something like this for specifying an authentication method:

Code: Select all

$smtpTransport->setAuthMethod('CRAMMD5');
The transport already knows about all possible types and uses the ones that the SMTP server supports (so really you don't *need* to have the code you currently have).
arena
Forum Newbie
Posts: 11
Joined: Tue Jun 05, 2007 5:36 am

Re: CRAMMD5, LOGIN, PLAIN, PopB4Smtp and SwiftMailer 4

Post by arena »

Thank you for your quick answer,

the simpler the better, so i will let swiftmailer doing it automatically.
Post Reply