// check if fields passed are empty

if(empty($_POST['name'])   ||

   empty($_POST['email']) ||

   empty($_POST['message']) ||



echo "No arguments Provided!";

return false;


$name = $_POST['name'];

$email_address = $_POST['email'];

$message = $_POST['message'];

// create email body and send it

$to = ''; // hi mate thanks for purchase guna theme, just replace your email with

$email_subject = "Contact form submitted by:  $name";

$email_body = "You have received a new message. \n\n".

 " Here are the details:\n \nName: $name \n ".

 "Email: $email_address\n Message \n $message";

$headers = "From:\n";

$headers .= "Reply-To: $email_address";


return true;


했는데 메일이 가지않는문제발생

 sudo apt-get install sendmail

Indeed, the steps I took were 1) If sendmail isn't installed, install it: apt-get install sendmail 2) Configure hosts file correctly: nano /etc/hosts And make sure the line looks like this: localhost localhost.localdomain yourhostnamehere 3) Run the sendmail config and answer 'Y' to everything: sendmailconfig I restarted apache for good measure: service apache2 restart After that my mail was sending instantly.


sudo sendmailconfig

+ Recent posts