[英]PHP Send a mail to user mail address entered into a text box
我正在嘗試制作一個簡單的表單,向用戶定義/輸入的電子郵件地址發送指向他們的鏈接。
訪客>輸入郵件>點擊發送>接收帶有鏈接的郵件
但是我正在努力使其發揮作用。
$headers = "From: Siddharth Jain <email>\\r\\n"; $headers .= "Reply-To: Siddharth Jain <email>\\r\\n"; $headers .= "Return-Path: email\\r\\n"; $headers .= "Bcc: Siddharth Jain <email>\\r\\n"; $headers .= "PHP/" . phpversion();
$to = $_REQUEST['email']; $subject=""; $mailcontent='Codeword: '.$_POST["text_box"];
$to = $_REQUEST['email']; $subject=""; $mailcontent='Codeword: '.$_POST["text_box"];
$to = $_REQUEST['email']; $subject=""; $mailcontent='Codeword: '.$_POST["text_box"];
mail($to, $subject, $mailcontent, $headers);
將“ email”替換為您的電子郵件,將“ Siddharth Jain”替換為您需要在該電子郵件中顯示的名稱。
謝謝Mitali Mehta :)
得到這個工作。
<?php
// Contact subject
$subject ="mail subject";
// Details
$message="$detail";
// Mail of sender
$mail_from="no-reply@domain.com";
// From
$header="from: no-reply@domain.com";
// Enter your email address
$to = $_REQUEST['customer_mail'];
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "We've recived your information"
if($send_contact){
header("Location:http://www.domain.com/");
}
else {
echo "ERROR";
}
?>
萬一有人想要它:)這也向我發送了一份請求副本。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.