本文整理匯總了PHP中utf8::send_mail方法的典型用法代碼示例。如果您正苦於以下問題:PHP utf8::send_mail方法的具體用法?PHP utf8::send_mail怎麽用?PHP utf8::send_mail使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類utf8
的用法示例。
在下文中一共展示了utf8::send_mail方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: zenphoto_sendmail
function zenphoto_sendmail($msg, $email_list, $subject, $message, $from_mail, $from_name, $cc_addresses, $replyTo, $html = false)
{
$headers = sprintf('From: %1$s <%2$s>', $from_name, $from_mail) . "\n";
if (count($cc_addresses) > 0) {
$cclist = '';
foreach ($cc_addresses as $cc_name => $cc_mail) {
$cclist .= ',' . $cc_mail;
}
$headers .= 'Cc: ' . substr($cclist, 1) . "\n";
}
if ($replyTo) {
$headers .= 'Reply-To: ' . array_shift($replyTo) . "\n";
}
$result = true;
foreach ($email_list as $to_mail) {
$result = $result && utf8::send_mail($to_mail, $subject, $message, $headers, '', $html);
}
if (!$result) {
if (!empty($msg)) {
$msg .= '<br />';
}
$msg .= sprintf(gettext('<code>zenphoto_sendmail</code> failed to send <em>%s</em> to one or more recipients.'), $subject);
}
return $msg;
}