내 회사에 이메일을 보내려는 양식의 사이트와 양식을 작성한 사용자에게 다른 사이트가 있습니다. 사이트에 모든 추가 파일을 서버에로드했지만 테스트 할 양식을 채울 때 "찾을 수 없음"이라는 오류 메시지가 나타납니다. 그것을 처리하는 PHP의 GET 메서드를 사용하고 있습니다. 저는 PHP와 웹 디자인에 익숙하지 않습니다. 고맙습니다.PHP 스크립트가 이메일을 보내지 않거나 수신하지 않습니다
<?php
//Function that sends the email to the person who submitted the form
function send_email(){
//This sends an email to the person who submitted the form
// email fields: to, from, subject. Put your values here!
$sendermail = '[email protected]';
$from = "Company<".$sendermail.">";
$to = $_GET['email'];
$subject = 'Product Information';
$message = "A member of our sales team will be getting back to you shortly. Thank you for your interest in our great line of products."."\n\n"."Best Regards,"."\n\n"."The Team";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset=iso-8859-1' . "\n";
$headers .= 'From: '. $from . "\r\n" .
'Reply-To: '. $sendermail. "\r\n" .
'X-Mailer: PHP/' . phpversion();
$ok = @mail($to, $subject, $message, $headers);
//This sends the contents of the form submission to the website owner
$sendermail2 = $_GET['email'];
$from2 = $_GET['first-name'].' '.$_GET['last-name'].' <'.$sendermail2.'>';
$to2 = '[email protected]';
$subject2 = 'A customer submission from the product page';
$message2 = "Name: ". $_GET['first-name'] ." ". $_GET['last-name'] ."\n\n". "Company: ". $_GET['company'] ."\n\n". "Email: ". $_GET['first-name'] ."\n\n". "Interest: ".$_GET['Interest'];
$headers2 = 'MIME-Version: 1.0' . "\r\n";
$headers2 .= 'Content-type: text/plain; charset=iso-8859-1' . "\n";
$headers2 .= 'From: '. $from2 . "\r\n" .
'Reply-To: '. $sendermail2. "\r\n" .
'X-Mailer: PHP/' . phpversion();
$ok2 = @mail($to2, $subject2, $message2, $headers2);
}
return send_email();
?>
...이 코드는 HTML 페이지의 본문에 있습니다. 레드햇 서버에 대한
<FORM ACTION="http://www.server.com/html/form_process.php" METHOD=GET>
실행중인 메일 서버는 무엇입니까? – 3ventic
Apache/2.0.52 (Red Hat) 서버 – Jeremiah
Apache가 웹 서버입니다. 어떤 MAIL 서버를 실행하고 있습니까? PHP 메일 기능은 마술처럼 이메일을 보내지 않습니다. 예를 들어 Postfix와 같은 SMTP 서버로 연결됩니다. –