使い方(Howto)
2008/06/21
使い方 HOW TO
関数リファレンスはこちらもっとも単純なメール
使う前に、qd_simple_mail.phpをインクルードしてください。
include('qd_simple_mail.php');
$to = 'to@example.com';
$to_name = '○○さん';
$subject = 'お問い合わせの件';
$from = 'from@example.com';
$content = 'メールの本文';
qd_simple_mail( $to , $to_name , $subject , $content , $from );
フロムにも、マルチバイトの名前を付ける。
$to = 'to@example.com'; $to_name = '○○さん'; $subject = 'お問い合わせの件'; $from = 'from@example.com'; $from_name = '××事務局'; $content = 'メールの本文'; qd_simple_mail( $to , $to_name , $subject , $content , $from ,$from_name);
cc,bcc,reply-toを加える
ccには、日本語名を加え、bccにはメールアドレスだけの例
$to = 'to@example.com';
$to_name = '○○さん';
$subject = 'お問い合わせの件';
$from = 'from@example.com';
$content = 'メールの本文';
$additional = array(
'Cc'=>array('cc@example.com','▲▲さん'),
'Bcc'=>'bcc@example.com',
'Reply-to'=>'reply@example.com',
);
qd_simple_mail( $to , $to_name , $subject , $content , $from , null ,$additional );
さらに 本文をutf-8 & base64エンコード
$to = 'to@example.com';
$to_name = '○○さん';
$subject = 'お問い合わせの件';
$from = 'from@example.com';
$content = 'メールの本文';
$additional = array(
'Cc'=>array('cc@example.com','▲▲さん'),
'Bcc'=>'bcc@example.com',
'Reply-to'=>'reply@example.com',
);
$option = array(
'CHARSET_CONTENT'=>'utf-8',
'ENC_CONTENT'=>'base64',
);
qd_simple_mail( $to , $to_name , $subject , $content , $from , null ,$additional , $option );