Problem with SwiftMailer...

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
whit3fir3
Forum Newbie
Posts: 3
Joined: Tue Apr 01, 2008 11:26 am

Problem with SwiftMailer...

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Problem with SwiftMailer...

Post 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.
whit3fir3
Forum Newbie
Posts: 3
Joined: Tue Apr 01, 2008 11:26 am

Re: Problem with SwiftMailer...

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Problem with SwiftMailer...

Post by John Cartwright »

What are the error messages when using -bs?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Problem with SwiftMailer...

Post 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.
Post Reply