領域我發送郵件下面的代碼:如何包括電子郵件
$email_to = '[email protected]';
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$headers = 'From: ' . $name . ' <' . $email_to . '>' . "\r\n" . 'Reply-To: ' . $email;
if(mail($email_to, $subject, $message, $headers)) {
echo 'sent'; // sending this text to the ajax request telling it that the mail is sent..
} else {
echo 'failed'; // ... or this one to tell it that it wasn't sent
}
郵件發送正常,但我需要與消息一起顯示的電話號碼。我相信這是一個簡單的解決方法,我會全部「doh!」當有人教我時,讓我們來解決吧! :)
此代碼可通過SMTP注入攻擊:https://www.hellboundhackers.org/articles/867-smtp-injection.html –
不理解爲什麼-3票。這是一個101個問題,但有效的是無效的。 – 86Stang