coder4Ever Posted October 29, 2009 Share Posted October 29, 2009 Hi friends, I was using the following code to send email to the owner of the site that I am developing(i.e the comments of the users to be send directly to the owner of the company) Here is the PHP CODE ?php $to='[email protected]'; $from=$_POST['txtEmail']; $title=$_POST['txtTitle']; $body=$_POST['txtMsg']; if($_POST['form1'].submit)// to check wheter the form has been sent or not //echo 'thank you' ; { if(mail($to,$title,$body,'From:'.' '.$from)) { echo '<h1 class="pageName" >Thank you! </h1> <p>Email sent. We will contact you as soon as possible </p><p><br /></p>'; } else { echo '<h1 class="pageName">Email not sent! </h1> <p class="bodyText">Either the email you sent doesnt exist or you didnt fill the fields appropriately<p><br /> </p>'; } } ?> People told me to make correction to the php_ini() file .... and I did that too ... i.e i changed the SMPT and i.e to our ISP i.e smtp.ethionet.et But still there is a problem ... the following is the error occurred when send button is clicked. Here is it Warning: mail() [function.mail]: Failed to connect to mailserver at "ethionet.et" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Hiwi\send.php on line 133 Email not sent! Either the email you sent doesnt exist or you didnt fill the fieldsappropriately By the way can I send the email to the owner while I am online before hosting the website? Link to comment https://forums.phpfreaks.com/topic/179535-problem-occurred-while-using-mail-function/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 29, 2009 Share Posted October 29, 2009 I hope you when you view your post above that you ask yourself if anyone could possibly read the yellow on white text. Link to comment https://forums.phpfreaks.com/topic/179535-problem-occurred-while-using-mail-function/#findComment-947337 Share on other sites More sharing options...
coder4Ever Posted October 29, 2009 Author Share Posted October 29, 2009 Sorry dude.... what about now? Link to comment https://forums.phpfreaks.com/topic/179535-problem-occurred-while-using-mail-function/#findComment-947343 Share on other sites More sharing options...
coder4Ever Posted October 29, 2009 Author Share Posted October 29, 2009 I hope you when you view your post above that you ask yourself if anyone could possibly read the yellow on white text. What about now dude? Link to comment https://forums.phpfreaks.com/topic/179535-problem-occurred-while-using-mail-function/#findComment-947346 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.