質問 > その他 > メール送信時の改行について教えて下さい。 |
その他
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | 下へ |
投稿者 | スレッド |
---|---|
nanasess |
投稿日時: 2007/8/28 14:46
対応状況: −−−
|
神 登録日: 2006/9/9 居住地: 投稿: 2313 |
Re: メール送信時の改行について教えて下さい。 引用:
mbstring.language の値はどうなっていますか? |
ゲスト |
投稿日時: 2007/8/28 16:57
対応状況: −−−
|
Re: メール送信時の改行について教えて下さい。 どこの部分の値を聞かれているのかがわからないので長文となり申し訳ございませんがGC_SendMail.phpを全文入れます。
<?php //--- テキスト/HTML メール送信 class GC_SendMail { var $html; // HTML メールヘッダー var $to; // 送信先 var $subject; // 題名 var $body; // 本文 var $header; // ヘッダー var $return_path; // return path var $mailer; /* ヘッダ等を格納 $to -> 送信先メールアドレス $subject -> メールのタイトル $body -> メール本文 $fromaddress -> 送信元のメールアドレス $header -> ヘッダー $from_name -> 送信元の名前(全角OK) $reply_to -> reply_to設定 $return_path -> return-pathアドレス設定(エラーメール返送用) $cc -> カーボンコピー $bcc -> ブラインドカーボンコピー */ function setTo($to, $to_name = "") { if($to_name != "") { $name = ereg_replace("<","<", $to_name); $name = ereg_replace(">",">", $name); $name = mb_encode_mimeheader(mb_convert_encoding($name, "JIS", CHAR_CODE)); $this->to = $name . "<" . $to . ">"; } else { $this->to = $to; } } function setItem( $to, $subject, $body, $fromaddress, $from_name, $reply_to, $return_path, $errors_to="", $bcc="", $cc ="" ) { $this->to = $to; $this->subject = $subject; // iso-2022-jpだと特殊文字が?で送信されるのでJISを使用する。 $this->body = mb_convert_encoding( $body, "JIS", CHAR_CODE); // ヘッダーに日本語を使用する場合はMb_encode_mimeheaderでエンコードする。 $from_name = ereg_replace("<","<", $from_name); $from_name = ereg_replace(">",">", $from_name); $from_name = mb_convert_encoding($from_name,"JIS",CHAR_CODE); $this->header = "From: ". Mb_encode_mimeheader( $from_name )."<".$fromaddress.">\n"; $this->header .= "Reply-To: ". $reply_to . "\n"; $this->header .= "Cc: " . $cc. "\n"; $this->header .= "Bcc: " . $bcc . "\n"; $this->header .= "Errors-To: ". $errors_to ."\n"; $this->return_path = $return_path; } function setItemHtml( $to, $subject, $body, $fromaddress, $from_name, $reply_to, $return_path, $errors_to="", $bcc="", $cc ="" ) { $this->to = $to; $this->subject = mb_encode_mimeheader($subject); $this->body = mb_convert_encoding( $body, "JIS", CHAR_CODE); $this->header = "Mime-Version: 1.0\n"; $this->header .= "Content-Type: text/html; charset=iso-2022-jp\n"; $this->header .= "Content-Transfer-Encoding: 7bit\n"; $this->header .= "From: ". Mb_encode_mimeheader( $from_name )."<".$fromaddress.">\n"; $this->header .= "Reply-To: ". $reply_to . "\n"; $this->header .= "Cc: " . $cc. "\n"; $this->header .= "Bcc: " . $bcc . "\n"; $this->header .= "Errors-To: ". $errors_to ."\n"; $this->return_path = $return_path; } // メール送信を実行する function sendMail() { Mb_language( "Japanese" ); // メール送信 $this->body = str_replace("\r", "\n", str_replace("\r\n", "\n", $this->body)); if( mb_send_mail( $this->to, $this->subject, $this->body, $this->header) ) { return true; } return false; } function sendHtmlMail() { Mb_language( "Japanese" ); // メール送信 $this->body = str_replace("\r", "\n", str_replace("\r\n", "\n", $this->body)); if( mb_send_mail( $this->to, $this->subject, $this->body, $this->header) ) { return true; } return false; } } ?> 現在このようになっております。 |
|
« 1 (2) |
スレッド表示 | 新しいものから | 前のトピック | 次のトピック | トップ |