Page 1 of 1
SwiftMailer not sending e-mails
Posted: Tue May 27, 2008 9:06 am
by scirious
Hi people,
I'm not sure this is the right forum but as I couldn't find the right one I hope I can post it here.
The problem is that I'm using SwiftMailer to send e-mails. On my develop box, which is using a Windows XP with WAMP, I can send e-mails easily. However, when I send the very same code to a CentOS 5 server no message is sent, even though nothing has been changed.
Both the server and the Windows XP box have the same setup for PHP (PHP5) excluding the obvious differences needed. On the server side I can telnet to the mail server, so it seems that the firewall isn't blocking SMTP connectios.
I don't know what cam be happening. Does anyone have any ideas?
TIA,
Scirious.
Re: SwiftMailer not sending e-mails
Posted: Tue May 27, 2008 8:01 pm
by Chris Corbyn
This is almost certainly going to be one of two things:
a) Relaying denied errors as the SMTP server being connected to has restrictions in place
b) Spam blocking at the recipient's end (the server will have a different spam rating)
It's not really possible for me to give you much help without more info I'm afraid. Perhaps have a read of this:
http://swiftmailer.org/wikidocs/v3/tips/spam
Re: SwiftMailer not sending e-mails
Posted: Wed May 28, 2008 7:27 am
by scirious
Well, now I'm in a serious trouble since the SMTP server and the e-mail info and message I'm using in the Windows box are the same ones I'm using in Linux and it doesn't seem to be blockin my e-mails, at least from the Windows box. And the destiny is recieving the e-mail sent by the Windows server, but not from the Linux one.
What is interesting here is that I get no error message, the e-mail just isn't sent and $swift->send(...) just returns 0. Now i'm completely lost. Is there a way to get from Swift Lib a message explaining the reason for not sending the e-mail even if no exception has been raised?
Thanks a lot,
Scirious.
Re: SwiftMailer not sending e-mails
Posted: Wed May 28, 2008 9:17 pm
by Chris Corbyn
Code: Select all
$log =& Swift_LogContainer::getLog();
$log->setLogLevel(4);
/* please your swift code here .... */
echo "<pre>", htmlentities($log->dump(true)), "</pre>";
Re: SwiftMailer not sending e-mails
Posted: Fri May 30, 2008 9:37 am
by scirious
Well, people, just to thank you very much for your help. Now I figered it out. I'm not sure why it happened but it was a problem with autentication. On a Windows box i could use my applicatiion to send an e-mail without authenticating to the server. I could also send it using authetication. However, on a Linux box the application had to authenticate to the mail server before sending the e-mail. Failing to do so would cause the e-mail to fail.
It is strange because the e-mail server is the same for both cases. It is even more strage because I found out the the server uses IMP and Swift Mailer isn't supposed to work with IMAP. But everthing seems to be working now.
Thank you very much,
Scirious.