Page 1 of 1

Problem with SwiftMailer...

Posted: Tue Apr 01, 2008 12:29 pm
by whit3fir3
I posted this a few mins ago, but it appears I posted it in the wrong section...

I have been using Swift Mailer on my web server for about 2 months now with out any problems. Then about a week ago the hosting company upgraded something and my mailer scripts stopped working. In my php code I changed the following line


Line number On/Off | Expand/Contract
$swift =& new Swift(new Swift_Connection_Sendmail("/usr/sbin/sendmail -bs"));

to

Line number On/Off | Expand/Contract
$swift =& new Swift(new Swift_Connection_Sendmail("/usr/sbin/sendmail -t"));

and it kind of works again except the messages that I get now have no body attached to them. Basically I get an email addressed to the correct person with no Subject and no Body.

Does anyone have any ideas of what I could try to get the message bodies back in the emails?

Thanks,

whit3fir3

Re: Problem with SwiftMailer...

Posted: Tue Apr 01, 2008 3:49 pm
by Chris Corbyn
Don't use -t. It states in the documentation that you shouldn't use it. You need -bs. -t and -bs make sendmail behave extremely differently.

In version 3 I was experimenting with -t support but never fully implemented it so it worked on some servers but not on others. Version 4 has complete -t support when it comes out however... I changed the whole transport subsystem in v4 which made supporting it much easier.

Re: Problem with SwiftMailer...

Posted: Wed Apr 02, 2008 10:35 am
by whit3fir3
Chris,

Thanks for your reply. The reason I started using -t is because when I use -bs now the script just fails. The error logs that are produced are not much help either. I started playing around with it and I found that when calling sendmail with the -t I atleast am getting the emails, I am just not getting any body with the emails. For the time being I have the issue resolved using the native PHP mail() function. I just thought I would post this and see if any one had any ideas. If not I'll wait for version before I start using -t again.

Thanks,

whit3fir3

Re: Problem with SwiftMailer...

Posted: Wed Apr 02, 2008 10:44 am
by John Cartwright
What are the error messages when using -bs?

Re: Problem with SwiftMailer...

Posted: Thu Apr 03, 2008 6:37 am
by Chris Corbyn
whit3fir3 wrote:Chris,

Thanks for your reply. The reason I started using -t is because when I use -bs now the script just fails. The error logs that are produced are not much help either. I started playing around with it and I found that when calling sendmail with the -t I atleast am getting the emails, I am just not getting any body with the emails. For the time being I have the issue resolved using the native PHP mail() function. I just thought I would post this and see if any one had any ideas. If not I'll wait for version before I start using -t again.

Thanks,

whit3fir3
Use the NativeMail connection since it just wraps mail() which does do "sendmail -t". I had valid reasons for not supporting -t in version 3 and didn't really go out of my way much to support it in version 4, it's just that supporting it in version 4 was effectively a few lines of extra code :)

-t mode as a general concept is not great IMO... you never find out your message failed to send until you get a bounce back in your inbox.