kmk4 Posted December 7, 2006 Share Posted December 7, 2006 hi every one i had strange problem i cant send email via my site i tried this code[code]<?php$to = 'myemail@example.com';$subject = 'test email';$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);?> [/code] i make a php file with this code only and i run it it didn't send emaili chick for sendmail path in the phpinfo.html it was correctso what is possible wrong with thisthank u for reading my topic Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted December 7, 2006 Share Posted December 7, 2006 your sending mail to myemail@example.comso is that your email address? Quote Link to comment Share on other sites More sharing options...
kmk4 Posted December 7, 2006 Author Share Posted December 7, 2006 @ProjectFear no ofcourse i'm not sending to myemail@example.com' i just type that for example i replace that with my real email Quote Link to comment Share on other sites More sharing options...
JJohnsenDK Posted December 7, 2006 Share Posted December 7, 2006 Do you get any errors?Would help alot if you could post them Quote Link to comment Share on other sites More sharing options...
the_oliver Posted December 7, 2006 Share Posted December 7, 2006 Your assuming that the server its sendin from is set up to send mail itself. Is it? Perhaps you have to define a mail server? Post your errors. Quote Link to comment Share on other sites More sharing options...
kmk4 Posted December 7, 2006 Author Share Posted December 7, 2006 @ JJohnsenDK no errors appear its excute the php without displayin any errors@the_oliveri assumed that .. after i use mail function ... it will send through php but i wanna try to set up sending form how could i do that ? Quote Link to comment Share on other sites More sharing options...
the_oliver Posted December 7, 2006 Share Posted December 7, 2006 [quote] chick for sendmail path in the phpinfo.html it was correct[/quote]If the php from did not spit out any errors then it is likley to be that your server is not set up to send mail correctly. One common resion for this is that the server can not resolve address propaly? Have you specified DNS server? In the comand line try to ping something like www.phpfreaks.com and see weather it resolves them? - Let us know.Can you try running the folowing code insted:[code]$success = mail("you@whatwhatever.com", "testmail", "somecontent", "From: <jim@jim.com>");if ($success){ print "Sent fine";}else{print "Not working";}[/code]Works on mine so im hoping it might on yours!Lastly try these to things:check sendmail is running: something like: service sendmail status (not sure what OS your runningAnd post the last fiew lines of your send mail log. somthing like nano /var/log/maillog i guess. Quote Link to comment Share on other sites More sharing options...
kmk4 Posted December 8, 2006 Author Share Posted December 8, 2006 i used your code it send maili tried mine again it works but after i changed my email i think the problem was the site was sending email to my hotmail account and the hotmail auto delete it i chicked junk mail there is nothing there but it works fine with gmail and yahoo i tried them bothproblem solvedthanks for every one that help me to solve my problem 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.