2016-12-05 89 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,它允許你有很多技巧,但它高度依賴於它的操作系統和應用程序。