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

Loading ...


*1

list($usec, $sec) = explode(" ", microtime());
$message_id = sprintf( "Message-Id: <%s.%s@%s>", mt_rand( $sec + $usec), md5( microtime()), $domain);

*2

$date = "Date: " . date( "r");

apache@example.com

function send_mail( $to, $subject, $message, $additional_headers = "", $additional_parameters = "", $additional_parameters) {

    $subject = str_replace( array( "\r\n", "\r"), "\n", $subject);
    $subject = str_replace( "\n", "\r\n", $subject);


    list($usec, $sec) = explode(" ", microtime());
    $message_id = sprintf( "Message-Id: <%s.%s@%s>", mt_rand( $sec + $usec), md5( microtime()), $domain);


    $additional_headers .= "\r\nMessage-Id: " . $message_id;
    $additional_headers .= "\r\nDate: " . date( "r");


    $cr = strstr(PHP_OS, 'WIN') !== false ? "\r\n" : "\n";


    $message = str_replace( array( "\r\n", "\r"), "\n", $message);
    $message = str_replace( "\n", $cr, $message);


    $additional_headers = str_replace( array( "\r\n", "\r"), "\n", trim( $additional_headers));
    $additional_headers = str_replace( "\n", $cr, $additional_headers);

    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;
}


*1
*2
*3 http://php.net/date
リロード   新規 編集 凍結 差分 添付 複製 改名   トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS
最終修正日時: Thu, 19 Jan 2006 14:24:08 JST (5967d)
文字数(HTML): 1667
文字数(Wiki): 3351
人気ブログランキング - よくきた wiki