本文整理汇总了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;
}