2016-12-05 87 views
0

以下函数可用,但我无法控制“主题”的字体大小。有没有办法改变“主题”的字体大小。我试过了:更改phpmailer主题的字体大小

$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('[email protected]');   
    $mail->IsHTML(true); 
    $mail->addAddress('[email protected]'); 

    $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(); 

}

回答

1

不,你不能做到这一点。主题行不支持HTML格式;它只是纯文本 - 不仅仅是因为主题电子邮件标题的定义早于HTML至少10年。

好的,你可以使用unicode,它允许你有很多技巧,但它高度依赖于它的操作系统和应用程序。