doa24uk Posted October 27, 2009 Share Posted October 27, 2009 Hi guys, Here's my code. Basically this sends a simple email & a script picks it up on the other end (the script has access to the inbox) and outputs the author. Obviously the author should ALWAYS be me@mysite.com with this script & it is .... maybe 3/10 times ... however the remaining 7 it defaults to a server allocated address - mysite@box975.myhost.com Why is it doing this? Am I trying to send too many emails in a short space of time?? $message = "A simple Email" mail( "yourname@example.com", "Email Subject", $message, "From: me@mysite.com" ); Quote Link to comment Share on other sites More sharing options...
bob2588 Posted October 27, 2009 Share Posted October 27, 2009 that code should work <?php $to = "me@mysite.com"; $from="me@mine.com"; $subject = "Hi!"; $body = "Massage"; if (mail($to, $from, $subject, $body)) { echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> Quote Link to comment Share on other sites More sharing options...
doa24uk Posted October 27, 2009 Author Share Posted October 27, 2009 hi, The emails were getting through it's just the sender was appearing incorrectly. It turns out that if you try and send a php mail() from a real existing address on the SAME server then it doesn't lookup the MX record correctly & so defaults to the server mail() daemon... weird but I got round it by using 547849875498754389@yahoo.com Quote Link to comment Share on other sites More sharing options...
bob2588 Posted October 27, 2009 Share Posted October 27, 2009 glad you got it bob Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.