contact_me.php


<?php

// check if fields passed are empty

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

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

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

   !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))

   {

echo "No arguments Provided!";

return false;

   }

$name = $_POST['name'];

$email_address = $_POST['email'];

$message = $_POST['message'];

// create email body and send it

$to = 'jasontody@gmail.com'; // hi mate thanks for purchase guna theme, just replace your email with emailme@myprogrammingblog.com

$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: 3layerglass@contact-3layerglass.com\n";

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

mail($to,$email_subject,$email_body,$headers);

return true;

?>




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


 sudo apt-get install sendmail


5
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: 127.0.0.1 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