테스트 사이트 - 개발 중인 베타 버전입니다

네이버 SMTP 발신자 설정 문의 채택완료

아기강도 6년 전 조회 5,045

안녕하세요.
formmail
네이버 SMTP 설정중

 

작성한 이메일을 발신자 이메일로 사용하려합니다

</p>

<p><?php

$config['use_smtp']    = true;    </p>

<p>// SMTP Server Settings

$config['smtp_host']    = 'smtp.naver.com';  

$config['smtp_port']    = 465;      

$config['smtp_user']    = '<a href="mailto:'help_dojangtong@naver.com'">****';</a>

$config['smtp_pass']    = '<a href="mailto:'filtech7704@'">****'</a>;   

$config['smtp_ssl']    = true;     

$config['send_to']    = <a href="mailto:'kyungsub0617@naver.com'">'****'</a>;   </p>

<p>// Email Subject

$config['subject']    = '온라인 문의'; // subject of emails you receive

?></p>

<p>

 

</p>

<p>  // SMTP ENABLED [isset = for old versions]

  if(!isset($config['use_smtp']) || isset($config['use_smtp']) && $config['use_smtp'] === true) {</p>

<p>   require('<a href="http://******/html/formmail/php/phpmailer/5.1/class.phpmailer.php');" target="_blank" rel="noopener noreferrer">http://******/html/formmail/php/phpmailer/5.1/class.phpmailer.php');</a></p>

<p>   $m = new PHPMailer();

   $m->IsSMTP();

   $m->SMTPDebug   = false;     // enables SMTP debug information (for testing) [default: 2]

   $m->SMTPAuth    = true;      // enable SMTP authentication

   $m->Host        = $config['smtp_host'];  // sets the SMTP server

   $m->Port        = $config['smtp_port'];  // set the SMTP port for the GMAIL server

   $m->Username    = $config['smtp_user'];  // SMTP account username

   $m->Password    = $config['smtp_pass'];  // SMTP account password

   $m->SingleTo    = true;

   $m->CharSet     = "UTF-8";

   $m->Subject  = $array['contact_subject'];

   $m->AltBody  = 'To view the message, please use an HTML compatible email viewer!';</p>

<p>   $m->AddAddress($config['send_to'], '온라인 문의');

   $m->AddReplyTo($array['contact_email'], $array['contact_name']);

   $m->SetFrom($config['smtp_user'], '온라인 문의');

   $m->MsgHTML($mail_body);</p>

<p>   if($config['smtp_ssl'] === true)

    $m->SMTPSecure = 'ssl';     // sets the prefix to the server</p>

<p>   // @SEND MAIL

   if($m->Send()) {

    die('_sent_ok_');

   } else {

    die($m->ErrorInfo);

   }</p>

<p>   unset($array, $m);</p>

<p>  }</p>

<p>  // mail()

  else {

   // mail( string $to , string $subject , string $message [, string $additional_headers [, string $additional_parameters ]] )

   mail($config['send_to'] ,$array['contact_subject'],$mail_body);

  }

 }</p>

<p>

위의 코드로 작성하였으나 보내는 사람메일이 smtp 계정 이메일이 아닌경우 에러가 나네요..

 

The following From address failed: ******@gmail.com
The following From address failed: ******@gmail.com<p>SMTP server error: 5.7.1 The sender address is unauthorized UQDKtTKpTHyPd5JD9GzyLA - nsmt

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

답변 1개

채택된 답변
+20 포인트
6년 전

보내는 사람메일이 smtp 계정 이메일이 아닌경우 에러가 나네요  >>> smpt 로그인을 해야 하니까 계정이 아니면 로그인이 안되죠. 에러는 당연할것 같네요.

로그인 후 평가할 수 있습니다

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

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

로그인