Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- php
- scala
- 베트남어
- ror실행
- nodejs express
- 메일왕창보내는법
- docker
- 명사 뽑아내기
- 스킨 스쿠버
- Eclipse
- 디즈니씨
- rss
- express for node.js
- ejb
- 나의 프로젝트
- 책이야기
- Node.js
- 명사 분석기
- 명사 추출기
- 도커
- 주식이야기
- node.js web framework
- Cross
- ajax
- iBatis
- C/C++
- php thumbnail
- Lift
- 나의 취미
- flex3
Archives
- Today
- Total
nkdk의 세상
php에서 메일 보내기~ 본문
간단하게 function으로 만들어 봤다
// メールを送信
function sendMail($to, $subject, $body, $from_email, $from_name) {
// カレントの言語を日本語に設定する
mb_language("ja");
// 内部文字エンコードを設定する
mb_internal_encoding("UTF-8");
$headers = "MIME-Version: 1.0 \n" ;
$headers .= "From: " . "".mb_encode_mimeheader(mb_convert_encoding($from_name,"ISO-2022-JP","AUTO")) ."" . "<".$from_email."> \n";
$headers .= "Reply-To: " . "".mb_encode_mimeheader(mb_convert_encoding($from_name,"ISO-2022-JP","AUTO")) ."" . "<".$from_email."> \n";
$headers .= "Content-Type: text/plain;charset=ISO-2022-JP \n";
$body = mb_convert_encoding($body, "ISO-2022-JP","AUTO");
$sendmail_params = "-f$from_email";
$result = mb_send_mail($to, $subject, $body, $headers, $sendmail_params);
return $result;
}
뭐 ^^
// メールを送信
function sendMail($to, $subject, $body, $from_email, $from_name) {
// カレントの言語を日本語に設定する
mb_language("ja");
// 内部文字エンコードを設定する
mb_internal_encoding("UTF-8");
$headers = "MIME-Version: 1.0 \n" ;
$headers .= "From: " . "".mb_encode_mimeheader(mb_convert_encoding($from_name,"ISO-2022-JP","AUTO")) ."" . "<".$from_email."> \n";
$headers .= "Reply-To: " . "".mb_encode_mimeheader(mb_convert_encoding($from_name,"ISO-2022-JP","AUTO")) ."" . "<".$from_email."> \n";
$headers .= "Content-Type: text/plain;charset=ISO-2022-JP \n";
$body = mb_convert_encoding($body, "ISO-2022-JP","AUTO");
$sendmail_params = "-f$from_email";
$result = mb_send_mail($to, $subject, $body, $headers, $sendmail_params);
return $result;
}
뭐 ^^