누군가 내게 메시지를 보낼 수있는 웹 사이트 양식이 있습니다. 그들은 그들의 이름, 이메일 및 메시지를 입력해야합니다.HTML 양식이 모든 데이터를 전송하지 않습니다.
양식이 전자 메일을받는 지점에서 작동하며 입력 한 보낸 사람 이름과 전자 메일은 전자 메일에는 표시되지만 입력 한 메시지에는 표시되지 않습니다.
누구든지 문제가있는 곳을 볼 수 있습니까? 여기
는 HTML 양식<form method="post" action="php/mail.php" name="cform" id="cform">
<input name="name" id="name" type="text" class="col-xs-12 col-sm-6 col-md-6 col-lg-6" placeholder="Your name..." >
<input name="email" id="email" type="email" class=" col-xs-12 col-sm-6 col-md-6 col-lg-6 noMarr" placeholder="Your email..." >
<textarea name="message" id="message" cols="" rows="" class="col-xs-12 col-sm-12 col-md-12 col-lg-12" placeholder="Your message..."></textarea>
<input type="submit" id="submit" name="send" class="submitBnt" value="Send message">
</form>
입니다 그리고 여기에 사용 (연결 세부 사항은 익명의 세부 사항에 변경)
<?
require("class.phpmailer.php");
//form validation vars
$formok = true;
$errors = array();
//sumbission data
$ipaddress = $_SERVER['REMOTE_ADDR'];
$date = date('d/m/Y');
$time = date('H:i:s');
//form data
$name = $_POST['name'];
$email = $_POST['email'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP - mail or smtp.domain.com
$mail->Host = "myhost.myprovider.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "mypassword"; // SMTP password
$mail->From = "[email protected]"; // SMTP username
$mail->AddAddress("[email protected]"); // Your Adress
$mail->Subject = "New contact request from ME !";
$mail->IsHTML(true);
$mail->CharSet = 'UTF-8';
$mail->Body = "<p>You have recieved a new message from the enquiries form on your website.</p>
<p><strong>Name: </strong> {$name} </p>
<p><strong>Email Address: </strong> {$email} </p>
<p><strong>Subject: </strong> {$subject} </p>
<p><strong>Message: </strong> {$message} </p>
<p>This message was sent from the IP Address: {$ipaddress} on {$date} at {$time}</p>";
if(!$mail->Send())
{
echo "Mail Not Sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
에서 값하지만 여전히 행운이 없기 때문에
<p><strong>Subject: </strong> {$subject} </p>
가 작동하지 않습니다 일을하려고하는 경우. 이메일에 아직 메시지가 표시되지 않습니다. 도움이 될 수도있는 경우 "제목"도 표시되지 않습니다. 제목은 php/mail.com에서 설정되었지만 – heyred