티스토리 뷰
xe에서 게시판 관리자 들어가면 글 쓰면 메일이 가는게 있다. 그런데 이런저런 이유로 잘 안가는 경우도 있다.
그래서 인터넷 찾아보면 여러가지 방법도 나와 있긴 한다.
일단 현재 xe에서 메일 보내는 방식은 아래와 같다.
board.controller.php 파일에 메일 보내는 부분
// send an email to admin user
if($output->toBool() && $this->module_info->admin_mail)
{
$oModuleModel = getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
$oMail = new Mail();
$oMail->setTitle($obj->title);
$oMail->setContent( sprintf("From : <a href=\"%s\">%s</a><br/>\r\n%s", getFullUrl('','document_srl',$obj->document_srl), getFullUrl('','document_srl',$obj->document_srl), $obj->content));
$oMail->setSender($obj->user_name ? $obj->user_name : 'anonymous', $obj->email_address ? $obj->email_address : $member_config->webmaster_email);
$target_mail = explode(',',$this->module_info->admin_mail);
for($i=0;$i<count($target_mail);$i++)
{
$email_address = trim($target_mail[$i]);
if(!$email_address) continue;
$oMail->setReceiptor($email_address, $email_address);
$oMail->send();
}
}
여기는 xe/classes/mail/Mail.class.php 파일
<?php
/* Copyright (C) NAVER <http://www.navercorp.com> */
require_once _XE_PATH_ . "libs/phpmailer/phpmailer.php";
/**
* Mailing class for XpressEngine
*
* @author NAVER (developers@xpressengine.com)
*/
class Mail extends PHPMailer
{
/**
* Sender name
* @var string
*/
var $sender_name = '';
/**
* Sender email address
* @var string
*/
var $sender_email = '';
.
.
.
}
/* End of file Mail.class.php */
/* Location: ./classes/mail/Mail.class.php */
Mail.class.php 파일은 phpmailer.php 파일을 임포트 하는것을 알 수 있다.
phpmailer.php 파일은 xe/libs/phpmailer/phpmailer.php 에 있다.
if (version_compare(PHP_VERSION, '5.0.0', '<') ) exit("Sorry, this version of PHPMailer will only run on PHP version 5 or greater!\n");
class PHPMailer {
/////////////////////////////////////////////////
// PROPERTIES, PUBLIC
/////////////////////////////////////////////////
/**
* Email priority (1 = High, 3 = Normal, 5 = low).
* @var int
*/
public $Priority = 3;
/**
* Sets the CharSet of the message.
* @var string
*/
public $CharSet = 'utf-8';
/**
* Sets the Content-type of the message.
* @var string
*/
public $ContentType = 'text/plain';
/**
* Sets the Encoding of the message. Options for this are
* "8bit", "7bit", "binary", "base64", and "quoted-printable".
* @var string
*/
public $Encoding = '8bit';
.
.
.
이 3개의 파일을 관찰하고 응용해보면 xe 에서 사용자 정의 메일을 보낼 수 있으리라..
'XE(XpressEngine) 팁' 카테고리의 다른 글
xe 외부페이지 내에서 include 하는 방법 (0) | 2017.06.22 |
---|---|
[xe개발] 게시판 글 쓰기 처리 순서 과정 (0) | 2017.06.22 |
xe가 설치된 루트 경로 가져오기 (0) | 2017.06.22 |
[xe] xe comment 댓글 외부페이지에서 쓰기 (0) | 2017.06.12 |
xe 외부페이지에서 xe document에 직접 insert 하는 방법 insDoc (0) | 2017.06.12 |
- Total
- Today
- Yesterday
- proc
- XE
- KG
- 인포믹스
- esql
- webix
- Python
- php
- ocajp
- 문자열
- 파이썬
- xe애드온
- 포인터
- 스크래핑
- 플러터
- 자바 smtp
- MySQL
- EC
- 파싱
- 자바
- C언어
- 오라클
- JDBC
- XE3
- xe addon
- 이클립스
- ocjap
- 프로씨
- 라이믹스 모듈
- C
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |