Hi Matts,
Thanks for the post!
Yeah, unfortunately this is a relatively common problem. PHP comes with a built-in mail() function which takes a few parameters, one of which is to specify the email headers. Headers are just "meta data" about the emails, including the recipient list, bccs, ccs etc. Emails that are sent as both HTML and text are known as "multipart" emails; the email client of the person who gets the email decides which one to view (html or text). The thing is, with PHP, to send multipart emails, the entire email content gets submitted in one long string through the headers and not the body of the script. It's just the way it works: very old school, very unintuitive - and can cause problems on some servers.
What happens is that a number of servers simply prevent you getting that much control over your email content, because if you can change and set the header content, it can open up the server to be being used as spam or sending fraudulent emails.
So anyway, long answer! The point is that a lot of servers prevent you from sending HTML+text emails, which is why it's throwing an error on your system.
To get around this, I bundle Form Tools with a Swift Mailer module that lets you configure it with an SMTP server to send emails. That's a far more reliable, consistent way to send emails. I'd suggest either looking into that, or limiting your email templates to only send in either text or HTML format.
http://modules.formtools.org/swift_mailer/
Hope the info helps, and good luck!
- Ben
Thanks for the post!
Yeah, unfortunately this is a relatively common problem. PHP comes with a built-in mail() function which takes a few parameters, one of which is to specify the email headers. Headers are just "meta data" about the emails, including the recipient list, bccs, ccs etc. Emails that are sent as both HTML and text are known as "multipart" emails; the email client of the person who gets the email decides which one to view (html or text). The thing is, with PHP, to send multipart emails, the entire email content gets submitted in one long string through the headers and not the body of the script. It's just the way it works: very old school, very unintuitive - and can cause problems on some servers.
What happens is that a number of servers simply prevent you getting that much control over your email content, because if you can change and set the header content, it can open up the server to be being used as spam or sending fraudulent emails.
So anyway, long answer! The point is that a lot of servers prevent you from sending HTML+text emails, which is why it's throwing an error on your system.
To get around this, I bundle Form Tools with a Swift Mailer module that lets you configure it with an SMTP server to send emails. That's a far more reliable, consistent way to send emails. I'd suggest either looking into that, or limiting your email templates to only send in either text or HTML format.
http://modules.formtools.org/swift_mailer/
Hope the info helps, and good luck!
- Ben