我已将以下参数添加到PHPMailer对象.虽然我使用AddEmbeddedImage()函数嵌入了用于内联目的的图像,但它按预期工作,但另外附加相同的图像作为附件到电子邮件并在底部显示.
$msg = `<table><tr><td colspan="2"><img src="cid:header_jpg" alt="www.example.in" width="770" height="4" border="0" /></td></tr></table>`;
$mail = new PHPMailer(true); //New instance, with exceptions enabled
$mail->IsSMTP(); // tell the class to use SMTP
$mail->SMTPAuth = false; // enable SMTP authentication
$mail->Port = 25; // set the SMTP server port
$mail->Host = 'localhost'; // SMTP server
$mail->Username = ""; // SMTP server username
$mail->Password = ""; // SMTP server password
$mail->AddReplyTo($sender, $sender_name);
$mail->From = $sender;
$mail->FromName = $sender_name;
$mail->AddAddress($receiver);
$mail->Subject = $subject;
//$mail->AltBody = "To view …Run Code Online (Sandbox Code Playgroud)