Jump to content

inbox mail rather than junk mail


sungpeng

Recommended Posts

two options

have a play around, try changing the "from" email to a legitimate email and putting a space between From: and sun@hotmail.com,

also you don't need \r\n in the header unless you do another line, i.e. reply-to

 

The example given at http://php.net/manual/en/function.mail.php is

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

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

 

Another option is to use something like the PHP Mailer class which I have found extremely useful.

http://phpmailer.worxware.com/

Link to comment
Share on other sites

 'Reply-To: sun@hotmail.com' . "\r\n" . 
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);

 

The above code sent a message to inbox not junk mail.. but the result is as follow..

 

From:	 server@hostingserver.com
Sent:	 03 July 2010 20: 13PM
To:	sungpeng@hotmail.com

 

The "FROM" is not "sun@hotmail.com" instead it is "server@hostingserver.com".. can I know is there any solution to it?

Link to comment
Share on other sites

change the hostingserver.com domain to your server the script is being run on.

i.e. if you're domain is www.sungpeng.com, change it to whatever@sungpeng.com

 

Is sun@hotmail.com your actual email? Obviously your spam filter is picking it up as spam, probably because its allegedly a email from a hotmail account coming from another domain, although I'm not 100% sure on what triggers said spam filters.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.