PHPMailer를 사용하여 수신자에게 개별 이메일을 보내려면 $mail->SingleTo = TRUE;
을 내 코드에 추가 할 때 받는 사람 : 필드에 아무것도 표시되지 않습니다.개별 이메일에 대한 PHPMailer 설정이 비어 있습니다.받는 사람 : 입력란
$mail->SingleTo = TRUE;
을 제거하면 받는 사람 : 필드에 정확한 전자 메일 주소가있는 전자 메일이 발송됩니다.
이
내가 무엇을 얻을 수 있습니다 :reply-to xxxxxx <[email protected]>, No Reply <[email protected]>
to
date Mon, Mar 21, 2011 at 5:07 PM
subject Testing
mailed-by gmail.com
signed-by gmail.com
(XXXXXXX 내 이메일 주소를 나타냅니다.)
여기내 코드입니다 :
if(isset($_POST['submit']))
{
require_once('PHPMailer_v5.1/class.phpmailer.php');
$mail = new PHPMailer();
$subject = $_POST['subject'];
$body = $_POST['emailbody'];
$to = $_POST['to'];
$mail->IsSMTP(); // telling the class to use SMTP
//$mail->Host = "localhost"; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "SSL"; // sets the prefix to the servier
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587; // set the SMTP port for the GMAIL server
$mail->Username = "[email protected]"; // GMAIL username
$mail->Password = "*********"; // GMAIL password
$mail->SetFrom('[email protected]', 'XXXXXX');
$mail->AddReplyTo("[email protected]","No Reply");
$mail->Subject = $subject;
// After adding this line I'm getting an empty To: field
$mail->SingleTo = TRUE;
$mail->AddAddress("[email protected]", 'xyz abc');
$mail->AddAddress("[email protected]", 'abc xyz');
//$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
$mail->MsgHTML($body);
if(!$mail->Send()) {
$message= "Mailer Error: " . $mail->ErrorInfo;
}
else
{
$message= "Message sent!";
}
}
질문이 접수되었지만 현상금이 열려 있습니까? 우리가 왜 현상금에 대한 답을 얻을 수 있을까요? –