Jump to content

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


dark_shadow87

Recommended Posts

Here my code

 

<?php

 

$to="dave_ren09@yahoo.com";

$sub="PHP Try";

$msg="Helo how are u!";

$from="admin@dave.com";

$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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.