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 = '[email protected]';$subject = 'test email';$message = 'hello';$headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\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 Link to comment https://forums.phpfreaks.com/topic/29770-email-sending-problem/ Share on other sites More sharing options...
JasonLewis Posted December 7, 2006 Share Posted December 7, 2006 your sending mail to [email protected]so is that your email address? Link to comment https://forums.phpfreaks.com/topic/29770-email-sending-problem/#findComment-136704 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 [email protected]' i just type that for example i replace that with my real email Link to comment https://forums.phpfreaks.com/topic/29770-email-sending-problem/#findComment-136708 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 Link to comment https://forums.phpfreaks.com/topic/29770-email-sending-problem/#findComment-136757 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. Link to comment https://forums.phpfreaks.com/topic/29770-email-sending-problem/#findComment-136776 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 ? Link to comment https://forums.phpfreaks.com/topic/29770-email-sending-problem/#findComment-137043 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("[email protected]", "testmail", "somecontent", "From: <[email protected]>");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. Link to comment https://forums.phpfreaks.com/topic/29770-email-sending-problem/#findComment-137163 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 Link to comment https://forums.phpfreaks.com/topic/29770-email-sending-problem/#findComment-137274 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.