내 PHP 이메일 스크립트가 전송되지 않는 것 같지만 왜 볼 수 없습니다. 또한 필자의 대본에 특정 보안 결함이 있다는 것을 알고 있으며 이에 대한 조언을 많이 부탁드립니다! 당신은 $email1
주위에 작은 따옴표를 사용하는PHP html 이메일을 보내지 않음
<?php
include('config.php');
$email1 = $_POST['email1'];
$id = $_POST['id'];
$fname = $_POST['fname'];
$firstname = $_POST['firstname'];
$surname = $_POST['surname'];
$to = '$email1';
$from = "$email";
$subject = "SC - You Have a Reply";
$body = "<html>
<body bgcolor=\"#FFFFFF\">
<center>
<b>Dear $firstname</b> <br>
<font color=\"red\">You have a response, regarding your Ad on StudentClutter!</font> <br>
<p> --------------------------------------------------------- </p>
<b> $fname </b>
<p> --------------------------------------------------------- </p>
<p> ".stripslashes($_POST['body'])." </p>
<br>
<br>
<br>
<p> You can reply to them by email: $emailadd </p>
<br>
<br>
<br>
<p>Thank you for using studentclutter.com </p>
<p> -- The Student Clutter Team </p>
</center>
</body>
</html>";
// To send the HTML mail we need to set the Content-type header.
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";
$headers .= "From: $from\r\n";
// now lets send the email.
mail($to, $subject, $body, $headers);
echo "Message has been sent!";
?>
어떤 종류의 오류가 발생합니까? 그것은 우리가 무엇이 잘못되었는지를 파악하는 데 도움이 될 수 있습니다. – Stegrex
http://swiftmailer.org/를 사용하면 문제가 해결되었습니다. –
@ Glavić 고맙습니다. 좋은 솔루션, 어떤 아이디어로 사용하는 것 같습니까? – neeko