폼 메일보내기가 안됨 채택완료
http://sir.co.kr/g5_skin/7322?sca=%EB%A0%88%EC%9D%B4%EC%95%84%EC%9B%83&page=4">http://sir.co.kr/g5_skin/7322?sca=%EB%A0%88%EC%9D%B4%EC%95%84%EC%9B%83&page=4
위 주소에 레이아웃을 사용중입니다
메일보내려면 아래 처럼 20번째줄 $to = 'test@naver.com'; // Add your email address inbetween the '' replacing
여기에 메일주소만 바꾸면 메일이 간다고 하는데
바꿔도 안가네요
왜그런지 알려주실분 ㅠ
<?php
header('Content-Type: text/html; charset=utf-8');
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
// Create the email and send the message
$to = 'test@naver.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to.
$email_subject = "Website Contact Form: $name";
$email_body = "You have received a new message from your website contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email_address\n\nPhone: $phone\n\nMessage:\n$message";
$headers = "From: mottocar1@naver.com\n"; // This is the email address the generated message will be from. We recommend using something like noreply@yourdomain.com.
$headers .= "Reply-To: $email_address";
$mail = false;
//$mail = mail($to,$email_subject,$email_body,$headers);
if($mail) { ?>
<script>
alert('메일을 전송 했습니다.');
history.go(-1);
</script>
<?php } else { ?>
<script>
alert('메일 전송에 문제가 있습니다. 관리자에게 문의 바랍니다.');
histroy.go(-1);
</script>
<?php } ?>
답변 1개
답변을 작성하려면 로그인이 필요합니다.
로그인