0

The following function works but I am unable to control the font-size of the "Subject". Is there a way to change the font size of the "Subject". I've tried:

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

but that didn't work.

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

}

DCR
  • 14,737
  • 12
  • 52
  • 115

1 Answers1

1

No, you can't do this. The Subject line does not support HTML formatting; it's plain text only - not least because the definition of the Subject email header predates HTML by at least 10 years.

On the upside, you can use unicode, which allows you quite a lot of tricks, but it's highly dependent on the OS and application it's viewed in.

Synchro
  • 35,538
  • 15
  • 81
  • 104