0

In PHP I have the following code that sends an email. Is there someway to encode it so that the email, when printed by the recipient, automatically prints in landscape?

          $email_subject = 'Crew List';

          // instantiate mailer
          $mail = new PHPMailer();        
          $mail->IsSMTP();
          $mail->SMTPAuth = true;         // enable SMTP authentication
          $mail->SMTPSecure = "tls";      // sets the prefix to the server
          $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server 
          $mail->Port = 587;              // set the SMTP port for the GMAIL server
          $mail->Username = "xxxxxx@gmail.com";
          $mail->Password   = "xxxxxx"; 
          $mail->SetFrom("yyyyyy@gmail.com");         // set From:
          $mail->AddAddress("zzzzzz@gmail.com");      // set To:
          $mail->Subject = $email_subject;            // set Subject:

          $body =  $msg;

 *        $mail->MsgHTML($body);             

          if ($mail->Send() === false)// send mail
           {
             apologize_index("Google was not able to connect, try again later");      
           }   



          $mail->ClearAddresses();               
DCR
  • 14,737
  • 12
  • 52
  • 115
  • What do you mean by "prints in landscape" – Shiji.J Apr 23 '15 at 23:18
  • most emails are printed in portrait when printed by the recipient. I want to override the default parameters that they have set up so when they print this email it automatically prints in landscape without them having to change their default options – DCR Apr 23 '15 at 23:20
  • No, this isn't possible. – Hamish Apr 23 '15 at 23:21

2 Answers2

0

I have a solution you may have a try:

Most of the email clients in this world supports HTML format. so you may use CSS to have a try.

Please have a look:

Landscape printing from HTML

So, generate your email as HTML format, and combine those CSS. The support for email clients is very mixed.

OR, why not just generate a landscape PDF as an attachment?

Community
  • 1
  • 1
Shiji.J
  • 1,561
  • 2
  • 17
  • 31
0

I think that's good option to make your email in the pdf format which should be in the landscape orientation.