Ok. This seriously blows. I make the website for a pretty big ski resort/vacation reservations company. On the website I have a bunch of forms for things like comments, vacation inquiries, ski school inquires, all that jazz. People fill out the form, the info is entered into the database, and an email is sent to whoever is in charge of that particular department. Everything worked just fine - until last month! The emails stopped arriving in people's inboxes! Here is my email code:
| Code: |
function sendmail($to, $subject, $message){ $headers = "From: Group Inquiry <donotreply@xxxxxxx.com> \r\n"; $headers .= "Content-Type: text/html; charset=\"UTF-8\"\r\n"; mail ($to, $subject, $message, $headers); } $subject="New Group Inquiry"; $to = "Groups <groups@xxxxxxx.com>"; $message = "<html><body><p>Group Name: ".$group_name."</p></body></html>"; |
This works fine when I send something to my gmail, but our work's email server blocks it, thinking that it is spam. One of our IT guys got rid of the \r\n (linebreaks) in the headers, and now the emails magically arrive!! The problem though... We needed those linebreaks! Now the emails arrive with the "from" field looking like "Group Inquiry Content-Type: text/html; charset=UTF-8" and so of course the html formatting in the email does not work. My question is: how do I get these emails to arrive with the custom headers that I need??