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

Loading ...


<?php
require_once 'Mail.php';

$recipients = array();
$recipients[] = 'to1@example.com';
$recipients[] = 'to2@example.com';

$headers = array();
$headers[ "From"]    = "from@example.com";
$headers[ "To"]      = "to1@example.com, to2@example.com";
$headers[ "Subject"] = "Test mail";

$body = "Test body";

$params = strstr( PHP_OS, "WIN") == FALSE? "-ffrom@example.com": "from@example.com";

$mailer =& Mail::factory( "mail", $params);
$mailer->send($recipients, $headers, $body);
?>

<?php
require_once 'Mail.php';

$recipients = array();
$recipients[] = 'to1@example.com';
$recipients[] = 'to2@example.com';

$headers = array();
$headers[ "From"]    = "from@example.com";
$headers[ "To"]      = "to1@example.com, to2@example.com";
$headers[ "Subject"] = "Test mail";

$body = "Test body";

$params = array();


$mailer =& Mail::factory( "sendmailmail", $params);
$mailer->send($recipients, $headers, $body);
?>

<?php
require_once 'Mail.php';

$recipients = 'to@example.com';

$headers = array();
$headers[ "From"]    = "from@example.com";
$headers[ "To"]      = "to@example.com";
$headers[ "Subject"] = "Test mail";

$body = "Test body";

$params = array();
$params[ "host"] = "localhost";
$params[ "port"] = 25;
$params[ "auth"] = "LOGIN";
$params[ "username"] = "username";
$params[ "password"] = "password";
$params[ "persist"] = FALSE;

$mailer =& Mail::factory( "smtp", $params);
$mailer->send($recipients, $headers, $body);
?>

リロード   新規 編集 凍結 差分 添付 複製 改名   トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS
最終修正日時: Thu, 23 Mar 2006 13:56:08 JST (4285d)
文字数(HTML): 1801
文字数(Wiki): 1812
人気ブログランキング - よくきた wiki