I'm changing this behaviour in forthcoming versions. I'm guessing you use a server which doesn't declare what types of authentication it supports... either that, or worse, it doesn't declare that it supports ESMTP.
I'm planning to just override whatever the server says anyway if the user requests to authenticate... you will get errors if the server doesn't like it though
jackbravo wrote:I guess I can live with that hehehe.
When do you think this new version will be ready?
Or what do you think about downloading the source from SVN?
Do you use tags on SVN? Is the trunk usually stable or pretty edgy =P?
Thanks!
trunk is stable actually (I work for a commercial project which uses Swift from the trunk directly via svn:externals), but those changes haven't been implemented yet. I can work on them over the next few days whilst we have a long weekend I'd like to have v3.2 out soon anyway which will include some new features, the main one of which (enhanced fail-safe batch mailing support) is already almost finished in svn.
The way the repository uses tags is pretty wasteful in some ways.... *every* single release gets tagged according to it's version number, even just revisions. It just makes it easy for me to quickly look up old code though when people contact me about bugs, or when I need to refer to older implementations. I don't think there's anything in branches currently; I don't really have a need for it because development is pretty focuses with just me writing it.
There is actually another thread here which addresses your probably in a hackaround fashion if you need something working right away... I'll see if I can dig it up
jackbravo wrote:As for the other hackish thread, Yep! any pointer would be usefull.
Somewhere far down in the thread I post a class, and the original poster in the thread gave some insight too. I'll have the code modified in svn within the next couple of days too so that providing a username and password forces Swift to just go ahead and give it a go. I just need to finish a couple of other things off first
EDIT | of course it would help if I remembered the damn link
<?php
require_once "lib/Swift.php";
Swift_ClassLoader::load("Swift_Connection_SMTP");
//Make a custom plugin just to hack at the responses and commands
class SayESMTP extends Swift_Events_Listener {
function responseReceived(&$e) {
if ($e->getCode() == 220) {
$e->setString("220 ESMTP whatever");
$swift =& $e->getSwift();
$swift->connection->setExtension("AUTH", array("LOGIN"));
}
}
}
$smtp =& new Swift_Connection_SMTP("server.tld");
$smtp->setUsername("user");
$smtp->setPassword("pass");
//Force swift to wait for us to load a plugin
$swift =& new Swift($smtp, null, SWIFT_NO_START);
$swift->attachPlugin(new SayESMTP(), "hack");
//Now connect
$swift->connect();
//and continue as usual
$swift->send( .... );
But didn't worked. I think the method responseReceived is not being executed because i wrote echos there and nothing appened. Also it keeps giving me a:
<?php
require_once "lib/Swift.php";
Swift_ClassLoader::load("Swift_Connection_SMTP");
//Make a custom plugin just to hack at the responses and commands
class SayESMTP implements Swift_Events_ResponseListener {
public function responseReceived(Swift_Events_ResponseEvent $e) {
if ($e->getCode() == 220) {
$e->setString("220 ESMTP whatever");
$swift = $e->getSwift();
$swift->connection->setExtension("AUTH", array("LOGIN"));
}
}
}
$smtp = new Swift_Connection_SMTP("server.tld");
$smtp->setUsername("user");
$smtp->setPassword("pass");
//Force swift to wait for us to load a plugin
$swift = new Swift($smtp, null, Swift::NO_START);
$swift->attachPlugin(new SayESMTP(), "hack");
//Now connect
$swift->connect();
//and continue as usual
$swift->send( .... );