Jump to content

PHP with Sendmail from apache@localhost


chant9

Recommended Posts

Im using the mail() function in PHP but when emails are sent to Hotmail accounts they are being classified as Junk.

 

I've checked the headers of the emails it is says they are being received from apache@localhost as shown below.

 

Received: (from apache@localhost)

 

I think this could be why they are considered junk, does anyone know how to configure sendmail for it to be recieved from something like webmaster@mydomain.co.uk?

I've tried various PHP things but nothing has helped so I'm assuming its something to do with the server configuration.

 

Many Thanks

Link to comment
Share on other sites

Going in junk is not part of any headers you put, it depends on your host ip etc. if you send mail too fast through a script they envelope and go at one time, the spam agents pick them up easily.. used to face this problem 4 years ago when I was into mailing stuff  ;D

 

anyways if I am wrong take look at this

 

<?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);
?> 

 

got it from

http://php.net/manual/en/function.mail.php

Link to comment
Share on other sites

Thanks Rajiv, I've tried this but it still went into the Junk.

 

Im not trying to send lots of emails only one from a webform.

 

I tried loads of different php mail() techniques now but they always go into Junk, which is why i think rather than the php code I think it could be the way the server/sendmail is configured with it always saying from apache@localhost.

 

Thanks anyway

 

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.