Changeset 16680 for branches/feature-module-update/html/test/naka/mail.php
- Timestamp:
- 2007/11/05 01:47:48 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-module-update/html/test/naka/mail.php
r16321 r16680 3 3 require_once("../../admin/require.php"); 4 4 5 //-- 文字を日本語に設定 6 Mb_language( "Japanese" ); 7 8 //-- 送信するメールの内容と送信先 9 $sendResut = array( 10 "to" => '[email protected]', // 顧客宛先 11 "Subject" => mb_encode_mimeheader("てすと"), // Subject 12 "From" => '[email protected]', // 送信元メールアドレス 13 "Reply-To" => '[email protected]', // reply_to 14 "Return-Path" => '[email protected]', // return_path 15 ); 16 17 //-- Mail_mimeオブジェクトにHTMLの本文を追加 18 $mailBody = mb_convert_encoding("テストです。", "JIS", CHAR_CODE); 19 20 //-- Mail_mimeオブジェクト作成 21 $mail_mimeObj = new Mail_mime(); 22 23 //-- メッセージの構築 24 $enc_param['head_charset'] = "ISO-2022-JP"; 25 $enc_param['html_encoding'] = "ISO-2022-JP"; 26 $enc_param['html_charset'] = "ISO-2022-JP"; 27 $mail_mimeObj->setHTMLBody($mailBody); 28 29 /* 30 $enc_param['text_charset'] = "ISO-2022-JP"; 31 $mail_mimeObj->setTXTBody($mailBody); 32 */ 33 34 $param = array( 35 //'host' => '216.255.239.201', 36 'host' => '210.188.192.18', 37 'port' => 25 38 ); 39 40 /* 41 array $headers - ヘッダの連想配列。 42 ヘッダ名が配列のキー、ヘッダの値が配列の値となります。 43 メールの envelope sender を書き換えたい場合は Return-Path ヘッダを設定します。 44 すると、この値が From ヘッダの値の代わりに用いられます。 45 */ 46 47 $body = $mail_mimeObj->get($enc_param); 48 $header = $mail_mimeObj->headers($sendResut); 49 50 //-- PEAR::Mailを使ってメール送信オブジェクト作成 51 $mailObj =& Mail::factory("smtp", $param); 52 // メール送信 53 $result = $mailObj->send($sendResut["to"], $header, $body); 54 55 if (PEAR::isError($result)) { 56 print($result->getMessage()); 57 } else { 58 print("ok"); 59 } 5 $objMail = new SC_SendMail(); 6 $objMail->setItem( 7 '[email protected]' // 宛先 8 , "aa" // サブジェクト 9 , "bb" // 本文 10 ,"[email protected]", 11 "" 12 ); 13 // 宛先の設定 14 $objMail->setTo("[email protected]", "[email protected]"); 15 16 //SC_Utils_Ex::sfPrintR($objMail); 17 $objMail->sendMail(); 18 19 print("ok"); 60 20 ?>
Note: See TracChangeset
for help on using the changeset viewer.
