本文整理匯總了PHP中NotificationMail::AddStringAttachment方法的典型用法代碼示例。如果您正苦於以下問題:PHP NotificationMail::AddStringAttachment方法的具體用法?PHP NotificationMail::AddStringAttachment怎麽用?PHP NotificationMail::AddStringAttachment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NotificationMail
的用法示例。
在下文中一共展示了NotificationMail::AddStringAttachment方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: NotificationMail
$secret = "l'été, ça roule !";
echo "From : $from\n";
echo "To : $dest\n";
echo "Date : $dat\n";
$mmail = new NotificationMail();
$mmail->From=$from;
$mmail->FromName="GLPI test";
$mmail->isHTML(true);
if ($enc) {
$mmail->Encoding = $enc;
}
$mmail->Subject="GLPI test mail" . ($enc ? " ($enc)" : '');
$mmail->Body="<html><body><h3>GLPI test mail</h3><p>Encoding = <span class='b'>$enc</span></p>".
"<p>Date = <span class='b'>$dat</span></p><p>Secret = <span class='b'>$secret</span>".
"</p></body></html>";
$mmail->AltBody="GLPI test mail\nEncoding : $enc\nDate : $dat\nSecret=$secret";
$mmail->AddAddress($dest, "");
$logo=file_get_contents("../pics/logo-glpi-login.png");
$mmail->AddStringAttachment($logo,'glpi.png',($enc?$enc:'base64'),'image/png');
$mmail->AddStringAttachment($secret,'secret.txt',($enc?$enc:'base64'),'text/plain');
echo "Send : ". ($mmail->Send() ? "OK\n" : "Failed (". $mmail->ErrorInfo.")\n");
?>