mail() problem


Posted on 16th Feb 2014 07:03 pm by admin

Hi Guys,

I've set up a contact email form. It sends the information fine, but it sends it to the junk folder.
If I just use this command:
$headers = "MIME-Version: 1.0 n";

It will send it to my inbox folder. If I use any other command after it in the $headers variable it will then send it to my junk folder.

Here is the full code I'm using:
Code: $to = "notanotherperson@hotmail.com";
$subject = $title;
$message = "<html><body>";
$message .= "<div style='border: 1px #ccc solid; padding: 5px; width: 100%; text-align: center'>";
$message .= "<b>Message From ". $name ."</b></div><br />";
$message .= "<div style='border: 1px #ccc solid; padding: 10px'>";
$message .= "Dear Emma,<br /><br />";
$message .= "<span>".$mess."</span></div>";
$message .= "</body></html>";
$headers = 'MIME-Version: 1.0' . "n";
$headers .= "From: ".$name."<".$email.">n";
$headers .= "Reply-To: ".$name."<".$email.">n";
$headers .= "Return-Path: ".$name."<".$email.">n";
$headers .= "cc: ". $name . "<".$email.">n";
$headers .= "X-Mailer: Drupaln";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "n";

mail($to, $subject, $message, $headers);

Thanks

232 Like 15 Dislike
Previous php-forum Next php-forum
Other php-forum

Unable to retreve the values from Mysql Query
Hi,

Here is the php code that I have, Query is running properly in phpmyadmin and is resu

Using real time in php
I'm very average at PHP and im looking to introduce time to something on my site.
Its a sports si

Need help adding a timestamp to my filename/variable
Hello,

I'm kind of stupid when it comes to php and I need a tiny bit of help. I've got a f

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

My XSRF Prevention code isn't working
First of all, thanks for the generous help you guys have given me in the past on this forum.
Seco

Thought I has this figured out especially after all the help i received?
Cags, Salathe, Daniel helped me with this yesterday, but not sure i took it all in.
I am attempti

Calender Not Opening
The following code is not loading the javascript calender in another window. It's not doing anything

Need help with unexpected T-STRING error
I'm a newbie and I'm still learning PHP. However this error has me stumped. I've googled, searched t

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash