Jump to content

Problem occurred while using mail() function


coder4Ever

Recommended Posts

  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?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.