728x90
<?php
header("Content-type:text/html;charset=utf-8");
function getSendMail($to,$from,$subject,$content,$html) {
if ($html == 'TEXT') $content = nl2br(htmlspecialchars($content));
$to_exp = explode('|', $to);
print_r($to_exp);
$from_exp = explode('|', $from);
$To = $to_exp[1] ? "\"".getUTFtoKR($to_exp[1])."\" <$to_exp[0]>" : $to_exp[0];
$Frm = $from_exp[1] ? "\"".getUTFtoKR($from_exp[1])."\" <$from_exp[0]>" : $from_exp[0];
$Header = "From:$Frm\nReply-To:$frm\nX-Mailer:PHP/".phpversion();
$Header.= "\nContent-Type:text/html;charset=EUC-KR\r\n";
return @mail($To,getUTFtoKR($subject),getUTFtoKR($content),$Header);
}
function getUTFtoKR($str) { return iconv('utf-8','euc-kr',$str); }
$to = "to@aa.com";
$from = "from@bbb.com";
$subject = "제목";
$content = "내용";
$html = "TEXT";
getSendMail($to,$from,$subject,$content,$html);
?>
728x90
'복붙 노트' 카테고리의 다른 글
운영중이 웹서버 압축 및 디비백업 크론탭 쉘스크립트 명령어 (0) | 2021.09.17 |
---|---|
하모니카OS 에서 snap 설치가 안될때 방법은? (0) | 2021.09.13 |
리액트 360 설치 및 체크 리뷰 (0) | 2021.09.03 |
탈중앙화 P2P 블록체인 브라우저 우분투에 설치 해보기 (0) | 2021.08.30 |
[Ubuntu/Linux] /etc/hosts 명령어 사용법 (0) | 2021.08.18 |
댓글