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
그다음
sudo sendmailconfig
'공부 > Linux' 카테고리의 다른 글
Nginx Php 세팅 오류/ 502 BadGateway ([emerg] "fastcgi_pass" directive is duplicate in /etc/nginx/sites-enabled/default:58) (0) | 2016.09.04 |
---|---|
php 파일업로드 크기 제한 설정 php.ini (nginx) (0) | 2016.02.14 |
Nginx 홈페이지 Rewrite (하드, 임시) (0) | 2015.11.15 |
Ubuntu Subdomain 설정하기(서브도메인) (0) | 2015.09.26 |
Ubuntu14.04 기본적인세팅(디지털오션기준) (0) | 2015.09.19 |