YanoRyuichi.com/
Wiki
Blog
GitHub
Sandbox
開始行:
* メール送信 [#f0579227]
function send_mail($data) {
$body = $data['body'];
$subject = $data['subject'];
$from = $data['from'];
$to = $data['to'];
$from_name = $data['from_name'];
$orig_enc = mb_internal_encoding();
mb_internal_encoding('ISO-2022-JP');
$subject = mb_convert_encoding($subject,'ISO-2022-JP'...
$subject = mb_encode_mimeheader($subject,'ISO-2022-JP...
$headers = '';
$from = sprintf('%s<%s>',
mb_encode_mimeheader (mb_convert_encoding($from_n...
$from
);
mb_internal_encoding($orig_enc);
$headers .= "From: $from\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/plain;charset=\"ISO-2...
$headers .= "Content-Transfer-Encoding: 7bit\n";
if (!is_array($to)) $to = array($to);
foreach ($to as $t) {
$result = mail($t,$subject,mb_convert_encoding(tr...
if (!$result) {
throw new Exception('メール送信に失敗しました...
}
}
}
終了行:
* メール送信 [#f0579227]
function send_mail($data) {
$body = $data['body'];
$subject = $data['subject'];
$from = $data['from'];
$to = $data['to'];
$from_name = $data['from_name'];
$orig_enc = mb_internal_encoding();
mb_internal_encoding('ISO-2022-JP');
$subject = mb_convert_encoding($subject,'ISO-2022-JP'...
$subject = mb_encode_mimeheader($subject,'ISO-2022-JP...
$headers = '';
$from = sprintf('%s<%s>',
mb_encode_mimeheader (mb_convert_encoding($from_n...
$from
);
mb_internal_encoding($orig_enc);
$headers .= "From: $from\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: text/plain;charset=\"ISO-2...
$headers .= "Content-Transfer-Encoding: 7bit\n";
if (!is_array($to)) $to = array($to);
foreach ($to as $t) {
$result = mail($t,$subject,mb_convert_encoding(tr...
if (!$result) {
throw new Exception('メール送信に失敗しました...
}
}
}
ページ名: