Qdmail - PHP::Mail Library , Quick and Detailed for Multibyte

2008/08/28() 2008-08-28

Qdmai潟若若吾<
  • 2008-08-28
    • 1.0.8b
<若荀綺絎сpriority<純菴遵
version()<純菴遵

荀綺荐絎

Qdmailс<若荀綺荐絎с障鐚3罧級鐚Qdmail 1.0.8b篁ラ罘純с

荀綺荐絎号

<若帥潟篁ヤс
high
normal
low

qd_send_mail() 劫翫鐚鴻<若箴鐚

$option = array(
    'type'=>'text',
    'option'=>array('priority'=>'high'),
);

qd_send_mail($option , $to , $subject ,$body );

OOP , easy鐔<純劫翫

$mailQdmailゃ潟鴻帥潟刻吾с鐚ャc障
$mail -> priority('high');
荀綺c潟祉
$mail -> priority('');
憜荀綺荐絎緇
$return_value = $mail -> priority( null );

篋ヨ

<若荀綺<若若絎茖≪蚊ゃ若荐絎違э鹿鐚障Qdmailс4ゃ若荐絎障吟с祉<若若紊т紊障
荐絎
X-Priority135
Priorityurgentnormalnon-urgent
X-MsMail-PriotiryHighNormalLow
ImportanceHighNormalLow
priority<純addHeader()<純4ゃ若荐絎с

URL

<若荀綺荐絎-Shin x blog

潟<潟若紊泣若

筝荐QR潟若茯水c阪遣肢宴<若c帥筝
鐚逸治<若≪鴻CC鐚鐚



阪遣≪鴻Cc≪鴻c潟<潟(Docomo)au純潟(Softbank)鐚ゃc≪潟<潟若紊紊<ゃ羞私<若с


decotest987.jpg
障顄水鴻decotest987 c障若hal456net障с潟<c帥筝


<帥潟<с<若c潟<潟若c菴c障

泣若鴻絎憗榊ヨ

ゃ潟帥若с≪帥ゃ<若

泣ゃ

宴若帥HTML<若ゃ茯帥鴻-c
潟<潟若潟潟障-綣鋍腓障激潟<綣 - 阪遣冴障茵
潟<若∫c若/泣若-Utilz

潟<潟若紊違泣潟

潟<潟若紊ゃ潟<潟若紊泣若
Qdmail + QdReceiver潟<潟3腮篏泣若鴻膣剛障
с違膣剛障

潟帥泣若種ゃ潟帥若鴻帥潟若
篆<<若с≪帥ゃPHP違ゃ潟帥若с≪帥ゃ<若т
#!/usr/local/php-5.2.6/bin/php-cgi

<?php

include('inc/qdmail.php');
include('inc/qdmail_receiver.php');

//
//罔羣ュ<若絎鴻莨若
//
$content = '';
$fp=fopen("php://stdin",'r') or die('File Open Error');
 while( !feof($fp) ){
    $content .= fgets( $fp );
 }
//
//<若潟若(Qdreceiver)
//
$DECODE = QdmailReceiver::start('direct',$content);
$from = $DECODE -> header(array('from','mail'));
$subject_summary = mb_substr(
    $DECODE -> header( array('subject','name') ) , 0 , 10
);

if(empty($subject_summary)){
    $subject_summary = 'Qdmail';
}else{
    $subject_summary .= 'tpl';
}

$cc = $DECODE -> header(array('cc','mail'));

//
//潟<潟若吾紊鐚3c鐚
//
$kinds = array('TPL_DC','TPL_AU','TPL_SB');
$carrier = array(
    'TPL_DC'=>'Docomo',
    'TPL_AU'=>'au',
    'TPL_SB'=>'SoftBankMobile'
);
$mime = array(
    'TPL_DC'=>'application/x-decomail-template',
    'TPL_AU'=>'application/x-kddi-htmlmail',
    'TPL_SB'=>'application/x-htmlmail-template'
);
$kakuchou = array('TPL_DC'=>'dmt','TPL_AU'=>'khm','TPL_SB'=>'hmt');

$ct = 0;
$mail = Qdmail::getInstance();

foreach($kinds as $kind){
    $attach[$ct]['DIRECT'] = $mail -> makeDecoTemplate($kind,$content);
    $attach[$ct]['PATH'] = $subject_summary.'_'.$carrier[$kind].'.'.$kakuchou[$kind];
    $attach[$ct]['MIME_TYPE'] = $mime[$kind];
    $ct++;
}
//
//腟篆
//
$add_header['From']='*****@*****.net';
$add_header['Reply-To']='****@*****.jp';

$to = array();
if(!empty($from)){
    $to[]=array($from);
}
if(!empty($cc)){
    $to[]=array($cc);
}

//若我
foreach($to as $key => $ad){
    if( false !== strpos($ad[0],'@****.****') ){
        unset($to[$key]);
    }
}


if(0===count($to)){
    die('Illegal Mail');
}


$mail -> reset();//cQdmail鴻祉鐚綽泣鐚
$body=<<<EOF
潟若絮障
綵鴻腴c蚊筝с膣剛

au潟若祉фゃ
羂ャ鴻頳潟俄札筝泣ゃ障с絲筝

Spok
http://hal456.net/
http://hal456.net/qdmail/decomail_base
http://www.cpa-lab.com/tech/
EOF;

$fg=qd_send_mail(
    'text',
    $to,
    '潟3腮潟若鐚荅薑鐚',
    $body,
    $add_header,
    $attach
);

潟<若障

Qdmail潟<若≪宴障障
QdmailPHPゃ医鐚鴻ユ茯鐚絖膂≦"潟¥潟<若鐚"HTML<若膈糸<若篆<с<若鴻ゃс絖絎区障
CakePHP潟潟若潟篏純с

Qdmail劫彰鐚潟♂∫o

Qdmail篏睡箴

Qdmail篏帥c潟<潟若紊泣若鐚篏泣ゃс鐚
泣潟潟若

篋ヨ

潟<紊с潟∝鎧au膤祉純潟膤祉障c冴惹阪遣ゃ若≪ゃWillcom純潟祉弱с
Qdmail後c≪с純若鴻潟若ч篆<с障

潟<若阪遣4腓MIME若罸莠

荐篋鴻

# 潟<篆<障Qdmail篏帥膂≦絎茖с障 羞宴腥吟篌弱堺ャ障...(2009/11/27 6:06)

# nakano Qdmail篏睡PCau阪遣鴻腟究絖潟若篆<激鴻罕膀障 篁ヤ泣ゃ茵...(2012/05/17 11:00)