PHP 메일() 기능을 사용하는 HTML 양식이 있습니다. 내가 사용하고있는 SMTP 서버는 localhost이며 인증을 필요로하지 않습니다.PHP는 HTML 메일을 보내지 않습니다.
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$call = $_POST['call'];
$website = $_POST['website'];
$message = $_POST['message'];
$formcontent = 'From: $name \n Phone: $phone \n Call Back: $call \n Website: $website \n Message: $message';
$recipient = '[email protected]';
$subject = 'Fused Enterprises Contact Form';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
$headers .= 'From: <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
mail($recipient, $subject, $formcontent, $headers) or die("Error!");
echo "Thank You, the form has been submitted. Someone from the Team will contact you shortly." . " -" . "<a href='/Home/' style='text-decoration:none; color:#1e90ff;'> Return Home</a>";
?>
내가 PEAR 메일을 구현해야합니까 : 여기
<form action="../../Scripts/fused.php" method="POST"><p>Name</p> <input type="text" name="name">
<p>Email</p> <input type="text" name="email">
<p>Phone</p> <input type="text" name="phone">
<p>Request Phone Call:</p>
Yes:<input type="checkbox" value="Yes" name="call"><br />
No:<input type="checkbox" value="No" name="call"><br />
<p>Website</p> <input type="text" name="website">
<p>Message</p><textarea name="message" rows="6" cols="25"></textarea><br />
<input type="submit" value="Send"><input type="reset" value="Clear">
</form>
는 PHP 파일입니까? 나는 그것을 구현하려고 노력했지만 이메일을받지 못했습니다. 그것이 실패하고 있는지 아닌지 나는 모른다. 스크립트가 실행되고
echo
이 표시되지만 이메일을받지 못합니다. 그것은 스팸 폴더에 가지 않았다.
이 사이트는 (이 스크립트와 함께) example.com
에 호스팅되지만 이메일은 smtp 서버 mail.example.com
과 함께 localhost를 사용합니다. 동일한 서버에서 호스팅됩니다. 도메인 이름의 차이가 문제가 될 수 있습니까?
당신이 말하는 http://ieeeaset.com/mailer/mailer.php는 "늘 보내는"당신은 오류를 준다거나 이메일을받지 않는다는 것을 의미합니까? 스팸 폴더를 확인 했습니까? –
이메일을받지 못했습니다. 나는 그것이 실패하고 있는지 여부에 관해서 어떤 징후도 가지고 있지 않다. 스팸 폴더도 확인했지만 2 개의 다른 이메일로 전송되며 수신하지도 않습니다. – user1453549
메일 로그를 확인하십시오. – Sammitch