업그레이드후 최신글 등록 이메일 수신안되요.

안녕하세요.

업그레이드후 최신글 등록 이메일이 수신이 안되고 있습니다.

확인 부탁드립니다.

수고하세요. 

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요
좋은 정보와 인맥을 동시에, 워드프레스 사용자 단톡방 참여하기
  • 테마의 page.php 파일 맨 하단에 아래 코드를 넣고 테스트 부탁드립니다.

    <?php 
    $result = wp_mail('이메일 주소', 'The subject', 'The message');
    print_r($result);
    ?>

    메일이 보내졌으면 화면 맨 하단에 '1'이 나올것 입니다.

    '1'이 나왔지만 실제로는 메일을 받지 못한 경우가 있고 또 다른 서버는 정상적으로 어떠한 메일주소를 입력해도 전송이 완료 되었습니다.

    서버마다 결과가 다른듯 한데요.

    호스팅 업체별로 메일전송 정책이 다를수도 있습니다. 이건 호스팅 업체에 물어보셔야 합니다. 메일이 전송되지 않는다고요.

    워드프레스 내장 메일 전송 기능대신 자체적으로 메일을 보내는 기능도 준비를 하겠습니다.

  • 안녕하세요.

    화면 맨 하단에 "1" 이 나온다고 하셧는데

    페이지를 열어보면 나타난다는 뜻인가요?

    홈페이지에는 아무런 글이 나타나지 않습니다.

    업그레이드  전에는 잘 되었는데 아되어서 답답합니다.

    다시한번 체크 부탁드립니다.

    감사합니다. 

  • 메일 기록을 확인해보니 

    8월 2일 업그레이드 적용이후부터 최신글 등록이 안되었습니다.

    이메일 최신글 적용되고

    다음 업그레이드에서 코드에 오류가 있지 않을 까 유추해봅니다.

     

  • KBMail.class.php 파일을 아래 링크 내용을 변경해보세요.

    https://raw.github.com/cosmosfarm/KBoard-wordpress-plugin/behind/plugins/kboard/KBMail.class.php

    <?php
    /**
     * KBoard 메일
     * @link www.cosmosfarm.com
     * @copyright Copyright 2013 Cosmosfarm. All rights reserved.
     * @license http://www.gnu.org/licenses/gpl.html
     */
    class KBMail {
    
    	var $to;
    	var $title;
    	var $content;
    
    	public function send(){
    		$admin_email = get_option('admin_email');
    
    		if(is_array($this->to)){
    			$this->to = implode(',', $this->to);
    			$this->to = str_replace(' ', '', $this->to);
    		}
    
    		$headers = 'MIME-Version: 1.0' . "\r\n";
    		$headers .= 'Content-type: text/html; charset=euckr' . "\r\n";
    		$headers .= "To: " . $this->to . "\r\n";
    		$headers .= "From: " . $admin_email . "\r\n";
    
    		$title = '[KBoard 신규등록] ' . $this->title;
    		$content = nl2br($this->content) . '<br><br><a href="'.site_url().'" onclick="window.open(this.href); return false;">'.site_url().'</a>';
    
    		$result = mail($to, iconv('utf8', 'euckr', $title), iconv('utf8', 'euckr', $content), iconv('utf8', 'euckr', $headers));
    		return $result;
    	}
    }
    ?>

     

  • 파일을 변경해서 적용했더니 에러가 나고 있습니다.

    Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1) in /home/hosting_users/iphonebuy/www/wp/wp-login.php on line 384

    Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1) in /home/hosting_users/iphonebuy/www/wp/wp-login.php on line 396

    Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1) in /home/hosting_users/iphonebuy/www/wp/wp-login.php on line 398

    Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1) in /home/hosting_users/iphonebuy/www/wp/wp-includes/pluggable.php on line 678

    Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1) in /home/hosting_users/iphonebuy/www/wp/wp-includes/pluggable.php on line 679

    Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1) in /home/hosting_users/iphonebuy/www/wp/wp-includes/pluggable.php on line 680

    Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1) in /home/hosting_users/iphonebuy/www/wp/wp-includes/pluggable.php on line 682

    Warning: Cannot modify header information - headers already sent by (output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1) in /home/hosting_users/iphonebuy/www/wp/wp-includes/pluggable.php on line 875

    다시한번 체크 부탁드립니다. 

  • 안녕하세요.

    output started at /home/hosting_users/iphonebuy/www/wp/wp-content/plugins/kboard/KBMail.class.php:1

    첫 번째 줄에 공백을 두신듯 합니다. 코드 이외의 공백이나 다른 TEXT는 없어야 합니다.

    헤더보다 먼저 공백이나 TEXT가 출력이 되면 보시는 오류가 발생합니다.

  • 업그레이드로 해결되었습니다.

    감사합니다. 

워드프레스 에러 기술지원 서비스 전문가에게 맡기세요