Jump to content

Help.... How to enable mail functio in PHP


dark_shadow87

Recommended Posts

Here my code

 

<?php

 

$to="[email protected]";

$sub="PHP Try";

$msg="Helo how are u!";

$from="[email protected]";

$header="From: " .$from;

 

mail($to,$sub,$msg,$header);

echo "Mail sent";

?>

 

Now... when i view it... it has the following error:

Failed to connect to mailserver at "mail.dave.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in

 

 

Please help...tnx

Link to comment
https://forums.phpfreaks.com/topic/121836-help-how-to-enable-mail-functio-in-php/
Share on other sites

Read the error carefully. It does not state anything wrong with you're code. You must setup a mail server for you're server. Most hosting have this configured automatically. However if you are using WAMP, LAMP or MAMP you might not have it configured. You should find how to set it up on google fairly easily.

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.