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 Link to comment https://forums.phpfreaks.com/topic/4811-sending-email-message/ 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.... Link to comment https://forums.phpfreaks.com/topic/4811-sending-email-message/#findComment-16925 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. Link to comment https://forums.phpfreaks.com/topic/4811-sending-email-message/#findComment-16926 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 Link to comment https://forums.phpfreaks.com/topic/4811-sending-email-message/#findComment-16990 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.