Changeset 16300


Ignore:
Timestamp:
2007/10/06 18:49:20 (16 years ago)
Author:
naka
Message:

Mail_mime利用関連モジュールの追加

Location:
branches/feature-module-update
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/module/Mail/mimeDecode.php

    r15532 r16300  
    7070        >  
    7171        > function decode_utf8($txt) { 
    72         > $trans=array("?#8216;"=>"探","撤"=>"短","?"=>"?#8226;","徹" 
    73         =>"?#8250;"); 
     72        > $trans=array("Å‘"=>"õ","ű"=>"û","Ő"=>"Õ","Å°" 
     73        =>"Û"); 
    7474        > $txt=strtr($txt,$trans); 
    7575        > return(utf8_decode($txt)); 
  • branches/feature-module-update/data/module/Mail/mimePart.php

    r15532 r16300  
    11<?php 
    22// +-----------------------------------------------------------------------+ 
    3 // | Copyright (c) 2002-2003  Richard Heyes                                     | 
     3// | Copyright (c) 2002-2003  Richard Heyes                                | 
    44// | All rights reserved.                                                  | 
    55// |                                                                       | 
  • branches/feature-module-update/html/admin/require.php

    r16296 r16300  
    3737require_once(CLASS_PATH . "helper_extends/SC_Helper_DB_Ex.php"); 
    3838 
     39require_once($include_dir . "/.." . HTML2DATA_DIR . "module/Mail/Mail.php"); 
     40require_once($include_dir . "/.." . HTML2DATA_DIR . "module/Mail/mime.php"); 
     41 
     42 
    3943// インストールチェック 
    4044SC_Utils_Ex::sfInitInstall(); 
  • branches/feature-module-update/html/test/naka/mail.php

    r15532 r16300  
    11<?php 
    22 
    3 ini_set("mbstring.http_output", "UTF-8"); 
    4 ini_set("mbstring.internal_encoding", "UTF-8"); 
     3require_once("../../admin/require.php"); 
    54 
    6 $to = "naka@lockon.co.jp"; 
    7 $body = "テストです。アイウロエ??????彅??"; 
     5            //-- 文字を日本語に設定 
     6            Mb_language( "Japanese" ); 
     7                   
     8            //-- 送信するメールの内容と送信先 
     9            $sendResut = array(  
     10                "to" => 'abnana210@softbank.ne.jp',             // 顧客宛先  
     11                "Subject" => mb_encode_mimeheader("てすと"),   // Subject   
     12                "From" => 'test01@lockon.co.jp',                // 送信元メールアドレス  
     13                "Reply-To" => 'test02@lockon.co.jp',            // reply_to  
     14                "Return-Path" => 'test03@lockon.co.jp',         // 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                                                  ); 
    839 
    9 $body = mb_convert_encoding($body, 'UTF-8', "EUC-JP"); 
    10  
    11 print("<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></head><body>\n"); 
    12 print("<b>" . $body . "</b>"); 
    13  
    14 echo("</body></html>"); 
    15  
    16 /* 
    17 mb_language("uni"); 
    18  
    19 if(mb_send_mail($to, "test", $body)){ 
    20     print("ok"); 
    21 } 
    22 */ 
    23  
    24  
    25  
     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            } 
    2660?> 
Note: See TracChangeset for help on using the changeset viewer.