【问题标题】:change font size for phpmailer subject更改 phpmailer 主题的字体大小
【发布时间】:2017-04-20 10:49:38
【问题描述】:

以下功能有效,但我无法控制“主题”的字体大小。有没有办法改变“主题”的字体大小。我试过了:

$mail->Subject = "<span style='font-size:3vw'>" .$mailInputs['subject'] ."<\span>";

但这没有用。

function mailerExpressBlueHost(array $mailInputs){
   require_once '../includes/phpmailer/PHPMailerAutoload.php';

   $mail = new PHPMailer();
   $mail->IsMail();   
   $mail->SetFrom('example@xyz.com');         
   $mail->IsHTML(true);
   $mail->addAddress('abc@example.com');

   $mail->AddEmbeddedImage("../public/img/swb.jpg", "swb-image"); 

      $body = '<!DOCTYPE html>
         <html><header>
            </header>
               <body lang=EN-US>
                  <div style="text-align:center">
                     <img src="cid:swb-image">' . $mailInputs['body'] ;

    $mail->isHTML(true); 
    $mail->Subject = $mailInputs['subject'] ;
    $mail->Body    = $body;




         if(!$mail->send()) {
         return 'Message could not be sent.' . 'Mailer Error: ' . $mail->ErrorInfo;

          } else {
         return 'Message has been sent';
          }





          $mail->ClearAddresses();

}

【问题讨论】:

    标签: phpmailer font-size


    【解决方案1】:

    不,你不能这样做。主题行不支持 HTML 格式;它只是纯文本 - 尤其是因为主题电子邮件标头的定义比 HTML 早了至少 10 年。

    从好的方面来说,您可以使用 unicode,它允许您使用很多技巧,但它高度依赖于查看它的操作系统和应用程序。

    【讨论】:

      猜你喜欢
      • 2015-11-04
      • 2014-02-19
      • 1970-01-01
      • 2019-02-05
      • 1970-01-01
      • 2019-10-29
      • 1970-01-01
      • 2019-01-30
      • 2015-07-04
      相关资源
      最近更新 更多