本文整理匯總了PHP中phpmailer::AddStringEmbeddedImage方法的典型用法代碼示例。如果您正苦於以下問題:PHP phpmailer::AddStringEmbeddedImage方法的具體用法?PHP phpmailer::AddStringEmbeddedImage怎麽用?PHP phpmailer::AddStringEmbeddedImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phpmailer
的用法示例。
在下文中一共展示了phpmailer::AddStringEmbeddedImage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendQRmail
function sendQRmail($from, $to, $subject, $msg, $qrcodeImage, $cid, $name)
{
include_once 'inc/class.phpmailer.php';
$mail = new phpmailer();
$mail->SMTPDebug = 0;
// debugging: 1 = errors and messages, 2 = messages only, 0 = off
$mail->IsSMTP();
// Set mailer to use SMTP
$mail->Host = 'mailhub.eait.uq.edu.au';
// Specify server
$mail->Port = 25;
// Server port: 465 ssl OR 587 tls
//$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
$mail->SMTPAuth = false;
// Enable SMTP authentication
$mail->Username = 's4329663@student.uq.edu.au';
// SMTP username
$mail->Password = 'hongzhe123999';
// SMTP password
$mail->SetFrom($from, 'QRappi');
// Sender
$mail->AddReplyTo($from, 'Support');
// Set an alternative reply-to address
$mail->AddAddress($to, 'User');
// Set who the message is to be sent to
$mail->Subject = $subject;
// Set the subject line
// Prepares message for html (see doc for details http://phpmailer.worxware.com/?pg=tutorial)
$mail->MsgHTML($msg);
// Add the image to the email as an inline element (i.e. not as an attachment)
$mail->AddStringEmbeddedImage($qrcodeImage, $cid, $name);
// Send the message, check for errors
$ok = $mail->Send();
return $ok;
}