| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read | ![]() |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi
I'm sending mail using a simple form and using the php mail() command. Whenever I send any email by this method the "sender" header is added/overwritten to "nobody@mirage.webhosting.uk.com". I have tried sending no headers. I have tried specifying the "sender" header. Whatever I do the "sender" is added or overwritten. I've looked in various places for information about this and it seems that I need to somehow set up a "trusted user". Has anyone had or know about this problem? Does anyone know how to stop the "sender" header being added/modified? Does anyone know how to add a "trusted user". Many thanks in advance. Dave |
|
|||
|
Please go through following code :-
<code> $to = 'sender@emailaddress.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: admin@yourdomain.com' . "\r\n" . 'Reply-To: admin@yourdomain.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> </code> This is what has been given to me by our Senior System Administrator. He has verified proper working of this php code.
__________________
Web Hosting UK - ASP MSSQL Hosting - cPanel Linux Hosting AIM : webredback || msn : andrew @ webhosting.uk.com Toll Free : 0808 262 0855 |
|
|||
|
Hi
Thank you for the quick response. Unfortunetly I am still getting the same problem. This is the code I have tried with as you suggested: <code> $to = 'walkerasindave@gmail.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: admin@theravedomain.co.uk' . "\r\n" . 'Reply-To: admin@theravedomain.co.uk' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); </code> These are the basic email headers I'm receiving when I check walkerasindave@gmail.com: <code>From: admin@theravedomain.co.uk Sender: nobody@mirage.webhosting.uk.com Reply-To: admin@theravedomain.co.uk To: walkerasindave@gmail.com</code> Its still coming up with the generic "sender" header. If you need a full list of all the headers received it can be found in the attached file. I am only really concerned about this header because it is visible in a number of email clients. If there is no way to remove I will just have to live with it ![]() Many thanks Dave Last edited by walkerasindave; 03-26-2007 at 02:04 PM. Reason: Added code tags for easy reading. |
|
|||
|
Hi
Thank you again for a quick response. With the new suggestion additions I'm still getting the "Sender" header appended. I've looked else where about it and it says something about adding a "trusted user". Does anyone know anything about this? Thanks again Dave |
|
|||
|
Hi, Am not sure about trusted user but I think this is set in php.ini??
Forgive me if i am wrong but using php simple mail functions will always return 'nobody@' won't it? All emails using PHP are sent via nobody@, this is normal behaviour as Apache runs as "nobody" on linux. I am sure! (Admin will know better.) One way around the problem you have is to use phpmailer at : <b>phpmailer.sourceforge.net</b>. I use this and it is a fantastic opensource mailing class. |
|
||||
|
FWIW I'd say you're right Jon - Apache does run as 'nobody' so it is, effectively, the sender.
I've used phpmailer in a few projects and it always does the job - I have heard that " <b> swiftmailer.org/ </b> is very good as well though (some would say better - more OO apparently).
__________________
homo sum: humani nil a me alienum puto ... ( just Google it ) |
|
|||
|
Quote:
your anchor text link has been just replaced by simple url of the site; url specified by you has not been edited; it's all for maintenance purpose. |
|
|||
|
Oh I see. I thought your forum was throwing a wobbly Harry.
|
|
|||
|
Quote:
Hi Thank you very much for everyone's responses. Thank you Jon, phpmailer works perfectly. Plus all the extra features are going to come in very useful. Thank you again for the help. Dave |
![]() |
| Thread Tools | |
| Display Modes | |
|
|