title: Yii, PHPMailer : how to send an email with HTML and ICS format
body: <p>I am trying to send an email with HTML and Ics format to gmail, outlook, yahoo, thunderbird, outlook express 2013 and iphone, but i am only able to send ics format to gmail, outlook and yahoo.</p>
  
  <p><strong>Issue</strong> I am not able to send html format in same mail<br>
  I tried with following code</p>
  
  <pre><code>public function createScheduleNotification(){
  
      $from = 'info@careervita.com';
      $fromName = 'info';
      $to = 'testcareervita@outlook.com';
      $subject = 'Invitation for Test Demo';
      $desc = 'THIS IS TEST DEMO INVITAION';
      $uid =  date('Ymd').'T'.date('His')."-".rand();
  
      $message =  "BEGIN:VCALENDAR\r\n";
      $message.=  "PRODID:-//Zoho CRM//NONSGML Calendar//EN\r\n";
      $message.=  "VERSION:2.0\r\n";
      $message.=  "X-WR-TIMEZONE:GMT\r\n";
      $message.=  "X-WR-CALNAME:ZCRM\r\n";
      $message.=  "METHOD:REQUEST\r\n";
      $message.=  "CALSCALE:GREGORIAN\r\n";
      $message.=  "BEGIN:VEVENT\r\n";
      $message.=  "UID:".$uid."\r\n";
      $message.=  "DESCRIPTION:".$desc."\r\n";
      $message.=  "ORGANIZER;CN= Manisha:mailto:manisha.g@careervita.com\r\n";
      $message.=  "DTSTART:20150710T100010Z\r\n";
      $message.=  "DTEND:20150710T110000Z\r\n";
      $message.=  "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN=Vinod T:mailto:g_manisha@outlook.com\r\n";
      $message.=  "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN=Vivek J:mailto:manisha.gaidhane8788@gmail.com\r\n";
      $message.=  "LOCATION:CV360\r\n";
      $message.=  "CREATED:20150701T060720Z\r\n";
      $message.=  "LAST-MODIFIED:20150701T060720Z\r\n";
      $message.=  "X-EVENT-OWNER:1563791000000084003\r\n";
      $message.=  "END:VEVENT\r\n";
      $message.=  "END:VCALENDAR";
  
      Yii::import('application.extensions.phpmailer.JPhpMailer');
          $mailer = new JPhpMailer(true);
          if (Yum::module()-&gt;phpmailer['transport'])
              switch (Yum::module()-&gt;phpmailer['transport']){
                  case 'smtp':
                      $mailer-&gt;IsSMTP();
                      break;
                  case 'sendmail':
                      $mailer-&gt;IsSendmail();
                      break;
                  case 'qmail':
                      $mailer-&gt;IsQmail();
                      break;
                  case 'mail':
                  default:
                      $mailer-&gt;IsMail();
              }
          else
              $mailer-&gt;IsMail();
              $mailer-&gt;IsHTML(true);
  
          $mailerconf=Yum::module()-&gt;phpmailer['properties'];
          if(is_array($mailerconf))
              foreach($mailerconf as $key=&gt;$value) {
                  if(isset(JPhpMailer::${$key}))
                      JPhpMailer::${$key} = $value;
                  else
                      $mailer-&gt;$key=$value;
              }
  
          $mailer-&gt;SetFrom($from); 
          $mailer-&gt;AddAddress($to); 
          $mailer-&gt;Subject = $subject;
          $mailer-&gt;Body = $message;
          $mailer-&gt;AddCC('testcareervita@gmail.com', 'Person One');
          $mailer-&gt;AddCC('testcareervita@yahoo.in', 'Person Two');
  
          $mailer-&gt;ContentType = 'text/calendar';
          $mailer-&gt;CharSet = 'UTF-8';
          $mailer-&gt;addCustomHeader("MIME-version : 1.0");
          $mailer-&gt;addCustomHeader('Content-type : text/calendar; name="testcal.ics"; method=REQUEST;');
          $mailer-&gt;addCustomHeader('Content-Transfer-Encoding:7bit'); //to interpret ics file
          $mailer-&gt;addCustomHeader("Content-class: urn:content-classes:calendarmessage"); 
          $mailer-&gt;addCustomHeader('Content-Disposition : inline; filename="testcal.ics"');
          return $mailer-&gt;Send(); 
  }
  </code></pre>
  
  <ol>
  <li>How to send HTML data within same email? <br></li>
  <li>Also for outlook .ics file is not getting for download <br>
  Any help will be appreciable</li>
  </ol>