Guest askjames01 Posted March 13, 2006 Share Posted March 13, 2006 I tried sending email messages without using the form...fortunately there was no error but the problem was i can't see the message in my inbox..these are the codes:[code]<?php$ip = $_SERVER['REMOTE_ADDR'];echo 'your I.P. address is: ';echo $ip;if($ip != '203.76.211.121') echo "ip not equal!\n";else { $recepient = "webmaster@domain_name.com"; $subject = "You have Guest!"; $contents = "Your ip is:" . $ip; $headers = "Reply-to: webmaster@domain_name.com\n"; mail($recepient, $subject, $contents, "From: webmaster@domain_name.com"); } }?>[/code]I wonder what was the problem with my codes or what do you think is lacking?-/james Quote Link to comment Share on other sites More sharing options...
Guest askjames01 Posted March 13, 2006 Share Posted March 13, 2006 Ok, just change the I.P. address with your address so it works with you.... Quote Link to comment Share on other sites More sharing options...
fusionpixel Posted March 13, 2006 Share Posted March 13, 2006 If I understand what you are saying you comment that you cant send emails through your browser?Some hosting companies block the ability to send emails through your browser. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted March 13, 2006 Share Posted March 13, 2006 You have:[code]<?php $headers = "Reply-to: webmaster@domain_name.com\n"; mail($recepient, $subject, $contents, "From: webmaster@domain_name.com");?>[/code]You create the $headers variable, but you don't use it. The "From:" header should be terminated with a new line character. You might have to include the fifth parameter on the mail() line.[code]<?php $headers = "From: webmaster@domain_name.com\n"; $headers .= "Reply-to: webmaster@domain_name.com\n"; $p5 = '-f webmaster@domain_name.com'; mail($recepient, $subject, $contents, $headers,$p5);?>[/code]The fifth parameter is almost always needed when sending to a Hotmail, Yahoo, Gmail, or AOL address.Ken 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.