LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 765 users online 224936 members 1300 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Memberlist | Dictionary | News | FAQ
Member Spotlight
atla2323
Favs: Movies lotr, never back down, taken, tra...
Mood: Tired
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
4 online / 44 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Adding Reply

Adding Reply
Archived Topic: It will not be bumped to the top of the forum.
Topic PHP email: emails are getting blocked by spam filters!
Membername   Not a member? Sign Up Free (takes 20 seconds)
Password   Forgotten your password?
Post

Font:   Size:   Color:

FAQ Keyword Search:
Post Options
Favorites Manager
Notify me of new replies to this topic by email
Notify me of new replies to this topic by private message
Original Post
PiXiE Posted at 12:31 pm on Mar. 9, 2007
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??

Replies
PiXiE Posted at 12:31 pm on Mar. 9, 2007
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??

All 9 previous replies displayed.