77;20202;0ccatbody - よくきたWiki

Loading ...


mail( $to, $subject, $message, $additional_headers, $additional_parameters);
Mail_I18n::send( $to, $subject, $message, $additional_headers, $additional_parameters);
    $from_address = str_replace( "\x00", "", $from_address);
    $from_name = str_replace( "\x00", "", $from_name);
    $mail_body = str_replace( "\x00", "", $mail_body);
    $from_address = preg_replace( "/[^a-z0-9\.\!(){}_@-]/i", "", $from_address);
    $from_name = Mail_I18n::escapeMailComment( $from_name);
.../shoeisha/kiwap2/01.mail/tests/contact-02.php
.../shoeisha/kiwap2/01.mail/tests/send_mail-02.php
.../shoeisha/kiwap2/01.mail/sources/contact-02.php

        if ( $to != "") {
            $additional_headers = "To: $to\n".$additional_headers;
        }
        if ( $subject != "") {
            $additional_headers = "Subject: $subject\n".$additional_headers;
        }

        $headers = preg_replace( "/[\x00-\x08\x0b\xec\x0e-\x1a0x1c-0x1f]/", "", $headers);
        $headers = str_replace( array( "\r\n", "\r"), "\n", $headers);
        $headers = preg_replace( "/[\n]+/", "\n", $headers);

        $prepare_headers = explode( "\n", $headers);
        $parsed_headers = array();
        $field_name = "";
        $field_value = "";
        foreach ( $prepare_headers as $line) {
            if ( preg_match( "/^([a-z0-9][^:]+):[ \t]*(.*)$/i", $line, $matches) != 0) {
                if ( $field_value != "") {
                    $parsed_headers[ strtolower( $field_name)] = $field_value;
                }
                $field_name = $matches[ 1];
                $field_value = $matches[ 2];
            } else {
                $field_value .= ltrim( $line);
            }
        }
        if ( $field_value != "") {
            $parsed_headers[ strtolower( $field_name)] = $field_value;
        }

escapeMailComment()
unescapeMailComment()
Mail_I18n::mimeEncodeFullString()
parseMailAddresses()
makeMailAddressField()
   /**

     *







     */
    /**

     *


     */
    /**

     *









     */
    /**

     *




     */

       if ( empty( $mail_headers[ "From"]) == TRUE) {

           $address = array(
             "comment"=>MAIL_I18N_UNSPECIFIED_SENDER_COMMENT,
             "address"=>MAIL_I18N_UNSPECIFIED_SENDER_ADDRESS
           );
           $mail_headers[ "From"] = Mail_I18n::makeMailAddressField( "From", array( $address));
           $sender = MAIL_I18N_UNSPECIFIED_SENDER_ADDRESS;
       }

       $sender = $sender != ""? $sender: MAIL_I18N_UNSPECIFIED_SENDER_ADDRESS;
       if ( empty( $mail_headers[ "Message-Id"]) == TRUE) {

           list($usec, $sec) = explode(" ", microtime());
           $mail_headers[ "Message-Id"] = sprintf( "<%s.%s%s>", mt_rand( 0, $sec + $usec), md5( microtime()), $sender);
       }
       if ( empty( $mail_headers[ "Date"]) == TRUE) {

           $mail_headers[ "Date"] = date( "r");
       }
       if ( empty( $mail_headers[ "MIME-Version"]) == TRUE) {

           $mail_headers[ "MIME-Version"] = "1.0";
       }
       if ( empty( $mail_headers[ "Content-Type"]) == TRUE) {

           $mail_headers[ "Content-Type"] = 'text/plain; charset="ISO-2022-JP"';
       }
       if ( empty( $mail_headers[ "Content-Transfer-Encoding"]) == TRUE) {


           $mail_headers[ "Content-Transfer-Encoding"] = "7bit";
       }
       $mail_headers[ "X-Mailer"] = "Powered by Mail_I18n Mailer http://oss.poyo.jp/";

        $header_info = Mail_I18n::parseHeaders( $additional_headers, FALSE);
        $mail_headers =& $header_info[ "headers"];

        $to = empty( $mail_headers[ "To"]) != TRUE? $mail_headers[ "To"]: "";
        unset( $mail_headers[ "To"]);
        $subject = empty( $mail_headers[ "Subject"]) != TRUE? $mail_headers[ "Subject"]: "";
        unset( $mail_headers[ "Subject"]);


        $envelop_from = empty( $mail_headers[ "Return-Path"]) != TRUE? $mail_headers[ "Return-Path"]: "";
        $from = empty( $mail_headers[ "From"]) != TRUE? $mail_headers[ "From"]: "";
        $envelop_from = $envelop_from != ""? $envelop_from: $from;

        $additional_headers = "";
        $line_feed = $is_windows == TRUE? "\r\n": "\n";
        foreach ( $mail_headers as $field_name=>$field_value) {
            $additional_headers .= ( rtrim( "$field_name: $field_value", "\r\n") . $line_feed);
        }
        if ( $envelop_from != "" && is_windows != TRUE) {
            $additional_parameters = "-f$envelop_from";
        }


        $message = str_replace( array( "\r\n", "\r"), "\n", $message);
        $message = str_replace( "\n", $line_feed, $message);
        $message = mb_convert_encoding( $message, "ISO-2022-JP");

        if ( ini_get( "safe_mode") == 1) {
            //  for safe_mode.
            $result = mail( $to, $subject, $message, $additional_headers);
        } else {
            //  for non safe_mode.
            $result = mail( $to, $subject, $message, $additional_headers, $additional_parameters);
        }
        return $result;

        $result = FALSE;

        if ( isset( $this) != TRUE) {
            $obj =& new Mail_I18n;
            $result = $obj->send( $to, $subject, $message, $additional_headers, $additional_parameters);
        } else {
            $result = $this->_send( $to, $subject, $message, $additional_headers, $additional_parameters);
        }
        return $result;

リロード   新規 編集 凍結 差分 添付 複製 改名   トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS
最終修正日時: Sun, 15 Feb 2009 00:23:40 JST (4846d)
文字数(HTML): 5988
文字数(Wiki): 11231
人気ブログランキング - よくきた wiki