채택완료

phpmailer 폼메일 제작시 문의하는 사람 메일 주소 값

2017-02-08 (수) 11:52:02 3,832
Copy
<?php include('./class.phpmailer.php'); function mailer($from, $from_email, $to, $to_email, $subject, $content, $files) {	$content = nl2br($content); 	$mail = new PHPMailer(true);	$mail->IsSendmail(); 	try {		$mail->CharSet    = "utf-8";		$mail->Encoding   = "base64";		$mail->AddAddress($to_email, $to);		$mail->SetFrom($from_email, $from);		$mail->AddReplyTo($from_email, $from);		$mail->Subject = $subject;		$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';		$mail->MsgHTML($content);		if($files[1] != "") $mail->AddAttachment("./temp/".$files[1]);		if($files[2] != "") $mail->AddAttachment("./temp/".$files[2]);		if($files[3] != "") $mail->AddAttachment("./temp/".$files[3]);			$mail->Send();		return true;	} catch (phpmailerException $e) {		echo $e->errorMessage();		return false;	} catch (Exception $e) {		echo $e->getMessage();		return false;	}} ?>

위의 $mail->SetFrom($from_email, $from); 보내는사람 메일 값을 그누보드@닷컴로

강제로 주려고하는데 여기서 값을 어떤식으로 설정하면될까요? 

|

답변 1개

채택된 답변
+20 포인트

$mail->SetFrom("그누보드@닷컴", "보내는이 이름"); 

답변을 작성하려면 로그인이 필요합니다.