我需要添加一個代碼到我的sendEmail.php波紋管,它將在兩個或多個收件人之間均勻旋轉。現在,所有的一切都是「sendto」[email protected]。所以我想添加更多[email protected],[email protected]等等。這樣每個人都會收到新鮮的線索。我的webform提交旋轉收件人
<?php
ob_flush();
session_start();
$_SESSION['username'] = $_POST['username'];
$_SESSION['email'] = $_POST['email'];
$_SESSION['phone'] = $_POST['phone_1']."- ".$_POST['phone_2']."- ".$_POST['phone_3'];
$_SESSION['liberation'] = $_POST['liberation'];
$sendto = "[email protected]";
$email = $_POST['email'];
$username= nl2br($_POST['username']);
$subject = "New lead from my website";
$headers = "From: <[email protected]> \r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html;charset=utf-8 \r\n";
$msg = "<html><body style='font-family:Arial,sans-serif;'>";
$msg .= "<p><strong>Name:</strong> ".$_POST['username']."</p>\r\n";
$msg .= "<p><strong>Sent by:</strong> ".$_POST['email']."</p>\r\n";
$msg .= "<p><strong>Phone No.: </strong> ".$_POST['phone_1']."- ".$_POST['phone_2']."- ".$_POST['phone_3']."</p>\r\n";
$msg .= "<p><strong> conviction date:</strong> ".$_POST['liberation']."</p>\r\n";
$msg .= "</body></html>";
@mail($sendto, $subject, $msg, $headers);
header("Location:continue.php");
?>
這將發送所有的收件人相同的領導 - 我需要發送每個收件人獨特的領導。第一位領導者來自webform並且只會去[email protected] - 然後第二位領導者只會去[email protected]等等 – user3577513
@ user3577513,您可以使用'foreach'分別發送他們,如答案中所示。 –