<?php
    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Credentials: true');

    date_default_timezone_set('America/Los_Angeles');

    $productDesc = $_REQUEST['prodDesc'];
    $imgName = $_REQUEST['shareImg'];
    $productURL = $_REQUEST['prodURL'];

    $toEmail = str_replace("'", "''", $_POST['toEmail']);
    $toName = str_replace("'", "''", $_POST['toName']);
    $fromEmail = str_replace("'", "''", $_POST['fromEmail']);
    $fromName = str_replace("'", "''", $_POST['fromName']);
    $message = $_POST['message'];

    list($settings, $encoded_string) = explode(',', $imgName);
    list($img_type, $encoding_method) = explode(';', substr($settings, 5));

    if($encoding_method == 'base64'){
      $file=fopen($imgName,'w+');
        fwrite($file,base64_decode($encoded_string)) ;
        fclose($file);
    }

    if(isset($toEmail) && $toEmail != '' && isset($imgName) && $imgName != '') {
      $from = 'Try-On by FaceCake <noreply@facecake.com>';

      require 'php/vendor/phpmailer/phpmailer/PHPMailerAutoload.php';

      $mail = new PHPMailer;

      //$mail->SMTPDebug = 3;                               // Enable verbose debug output

      $mail->isSMTP();                                      // Set mailer to use SMTP
      $mail->Host = 'mail.authsmtp.com';  // Specify main and backup SMTP servers
      $mail->SMTPAuth = true;                               // Enable SMTP authentication
      $mail->Username = 'ac55120';                 // SMTP username
      $mail->Password = 'swbszee6nxrpng';                           // SMTP password
      $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
      $mail->Port = 2525;                                    // TCP port to connect to

      $mail->From = 'noreply@facecake.com';
      $mail->FromName = 'Try-On by FaceCake';
      $mail->addAddress($toEmail);               // Name is optional
      //$mail->addReplyTo('info@example.com', 'Information');
      //$mail->addCC('cc@example.com');
      //$mail->addBCC('bcc@example.com');

      // $mail->addAttachment($userpicsPath . $imgName . '.jpg');         // Add attachments
      // $mail->addAttachment('/tmp/image.jpg', 'new.jpg');    // Optional name
      $mail->isHTML(true);                                  // Set email format to HTML

      $mail->Subject = 'My new NARS look';
      $mail->Body    = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- NAME: 1 COLUMN - BANDED -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Thank you for using NARS Cosmetics</title>
<style type="text/css">
body, #bodyTable, #bodyCell {
  height: 100% !important;
  margin: 0;
  padding: 0;
  width: 100% !important;
}
table {
  border-collapse: collapse;
}
img, a img {
  border: 0;
  outline: none;
  text-decoration: none;
}
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  padding: 0;
}
p {
  margin: 1em 0;
  padding: 0;
}
a {
  word-wrap: break-word;
}
.ReadMsgBody {
  width: 100%;
}
.ExternalClass {
  width: 100%;
}
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {
  line-height: 100%;
}
table, td {
  mso-table-lspace: 0pt;
  mso-table-rspace: 0pt;
}
#outlook a {
  padding: 0;
}
img {
  -ms-interpolation-mode: bicubic;
}
body, table, td, p, a, li, blockquote {
  -ms-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}
#bodyCell {
  padding: 0;
}
.mcnImage {
  vertical-align: bottom;
}
.mcnTextContent img {
  height: auto !important;
}
/*
  @tab Page
  @section background style
  @tip Set the background color and top border for your email. You may want to choose colors that match your company\'s branding.
  */
body, #bodyTable {
  /*@editable*/background-color: #F2F2F2;
}
/*
  @tab Page
  @section background style
  @tip Set the background color and top border for your email. You may want to choose colors that match your company\'s branding.
  */
#bodyCell {
  /*@editable*/border-top: 0;
}
/*
  @tab Page
  @section heading 1
  @tip Set the styling for all first-level headings in your emails. These should be the largest of your headings.
  @style heading 1
  */
h1 {
  /*@editable*/color: #606060 !important;
  display: block;
  /*@editable*/font-family: Helvetica;
  /*@editable*/font-size: 40px;
  /*@editable*/font-style: normal;
  /*@editable*/font-weight: bold;
  /*@editable*/line-height: 125%;
  /*@editable*/letter-spacing: -1px;
  margin: 0;
  /*@editable*/text-align: left;
}
/*
  @tab Page
  @section heading 2
  @tip Set the styling for all second-level headings in your emails.
  @style heading 2
  */
h2 {
  /*@editable*/color: #404040 !important;
  display: block;
  /*@editable*/font-family: Helvetica;
  /*@editable*/font-size: 26px;
  /*@editable*/font-style: normal;
  /*@editable*/font-weight: bold;
  /*@editable*/line-height: 125%;
  /*@editable*/letter-spacing: -.75px;
  margin: 0;
  /*@editable*/text-align: left;
}
/*
  @tab Page
  @section heading 3
  @tip Set the styling for all third-level headings in your emails.
  @style heading 3
  */
h3 {
  /*@editable*/color: #606060 !important;
  display: block;
  /*@editable*/font-family: Helvetica;
  /*@editable*/font-size: 18px;
  /*@editable*/font-style: normal;
  /*@editable*/font-weight: bold;
  /*@editable*/line-height: 125%;
  /*@editable*/letter-spacing: -.5px;
  margin: 0;
  /*@editable*/text-align: left;
}
/*
  @tab Page
  @section heading 4
  @tip Set the styling for all fourth-level headings in your emails. These should be the smallest of your headings.
  @style heading 4
  */
h4 {
  /*@editable*/color: #808080 !important;
  display: block;
  /*@editable*/font-family: Helvetica;
  /*@editable*/font-size: 16px;
  /*@editable*/font-style: normal;
  /*@editable*/font-weight: bold;
  /*@editable*/line-height: 125%;
  /*@editable*/letter-spacing: normal;
  margin: 0;
  /*@editable*/text-align: left;
}
/*
  @tab Preheader
  @section preheader style
  @tip Set the background color and borders for your email\'s preheader area.
  */
#templatePreheader {
  /*@editable*/background-color: #F2F2F2;
  /*@editable*/border-top: 0;
  /*@editable*/border-bottom: 0;
}
/*
  @tab Preheader
  @section preheader text
  @tip Set the styling for your email\'s preheader text. Choose a size and color that is easy to read.
  */
.preheaderContainer .mcnTextContent, .preheaderContainer .mcnTextContent p {
  /*@editable*/color: #606060;
  /*@editable*/font-family: Helvetica;
  /*@editable*/font-size: 11px;
  /*@editable*/line-height: 125%;
  /*@editable*/text-align: left;
}
/*
  @tab Preheader
  @section preheader link
  @tip Set the styling for your email\'s header links. Choose a color that helps them stand out from your text.
  */
.preheaderContainer .mcnTextContent a {
  /*@editable*/color: #606060;
  /*@editable*/font-weight: normal;
  /*@editable*/text-decoration: underline;
}
/*
  @tab Header
  @section header style
  @tip Set the background color and borders for your email\'s header area.
  */
#templateHeader {
  /*@editable*/background-color: #FFFFFF;
  /*@editable*/border-top: 0;
  /*@editable*/border-bottom: 0;
}
/*
  @tab Header
  @section header text
  @tip Set the styling for your email\'s header text. Choose a size and color that is easy to read.
  */
.headerContainer .mcnTextContent, .headerContainer .mcnTextContent p {
  /*@editable*/color: #606060;
  /*@editable*/font-family: Helvetica;
  /*@editable*/font-size: 15px;
  /*@editable*/line-height: 150%;
  /*@editable*/text-align: left;
}
/*
  @tab Header
  @section header link
  @tip Set the styling for your email\'s header links. Choose a color that helps them stand out from your text.
  */
.headerContainer .mcnTextContent a {
  /*@editable*/color: #6DC6DD;
  /*@editable*/font-weight: normal;
  /*@editable*/text-decoration: underline;
}
/*
  @tab Body
  @section body style
  @tip Set the background color and borders for your email\'s body area.
  */
#templateBody {
  /*@editable*/background-color: #FFFFFF;
  /*@editable*/border-top: 0;
  /*@editable*/border-bottom: 0;
}
/*
  @tab Body
  @section body text
  @tip Set the styling for your email\'s body text. Choose a size and color that is easy to read.
  */
.bodyContainer .mcnTextContent, .bodyContainer .mcnTextContent p {
  /*@editable*/color: #606060;
  /*@editable*/font-family: Helvetica;
  /*@editable*/font-size: 15px;
  /*@editable*/line-height: 150%;
  /*@editable*/text-align: left;
}
/*
  @tab Body
  @section body link
  @tip Set the styling for your email\'s body links. Choose a color that helps them stand out from your text.
  */
.bodyContainer .mcnTextContent a {
  /*@editable*/color: #6DC6DD;
  /*@editable*/font-weight: normal;
  /*@editable*/text-decoration: underline;
}
/*
  @tab Footer
  @section footer style
  @tip Set the background color and borders for your email\'s footer area.
  */
#templateFooter {
  /*@editable*/background-color: #F2F2F2;
  /*@editable*/border-top: 0;
  /*@editable*/border-bottom: 0;
}
/*
  @tab Footer
  @section footer text
  @tip Set the styling for your email\'s footer text. Choose a size and color that is easy to read.
  */
.footerContainer .mcnTextContent, .footerContainer .mcnTextContent p {
  /*@editable*/color: #606060;
  /*@editable*/font-family: Helvetica;
  /*@editable*/font-size: 11px;
  /*@editable*/line-height: 125%;
  /*@editable*/text-align: left;
}
/*
  @tab Footer
  @section footer link
  @tip Set the styling for your email\'s footer links. Choose a color that helps them stand out from your text.
  */
.footerContainer .mcnTextContent a {
  /*@editable*/color: #606060;
  /*@editable*/font-weight: normal;
  /*@editable*/text-decoration: underline;
}

@media only screen and (max-width: 480px) {
body, table, td, p, a, li, blockquote {
  -webkit-text-size-adjust: none !important;
}
}

@media only screen and (max-width: 480px) {
body {
  width: 100% !important;
  min-width: 100% !important;
}
}

@media only screen and (max-width: 480px) {
table[class=mcnTextContentContainer] {
  width: 100% !important;
}
}

@media only screen and (max-width: 480px) {
table[class=mcnBoxedTextContentContainer] {
  width: 100% !important;
}
}

@media only screen and (max-width: 480px) {
table[class=mcpreview-image-uploader] {
  width: 100% !important;
  display: none !important;
}
}

@media only screen and (max-width: 480px) {
img[class=mcnImage] {
  width: 100% !important;
}
}

@media only screen and (max-width: 480px) {
table[class=mcnImageGroupContentContainer] {
  width: 100% !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnImageGroupContent] {
  padding: 9px !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnImageGroupBlockInner] {
  padding-bottom: 0 !important;
  padding-top: 0 !important;
}
}

@media only screen and (max-width: 480px) {
tbody[class=mcnImageGroupBlockOuter] {
  padding-bottom: 9px !important;
  padding-top: 9px !important;
}
}

@media only screen and (max-width: 480px) {
table[class=mcnCaptionTopContent], table[class=mcnCaptionBottomContent] {
  width: 100% !important;
}
}

@media only screen and (max-width: 480px) {
table[class=mcnCaptionLeftTextContentContainer], table[class=mcnCaptionRightTextContentContainer], table[class=mcnCaptionLeftImageContentContainer], table[class=mcnCaptionRightImageContentContainer], table[class=mcnImageCardLeftTextContentContainer], table[class=mcnImageCardRightTextContentContainer] {
  width: 100% !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnImageCardLeftImageContent], td[class=mcnImageCardRightImageContent] {
  padding-right: 18px !important;
  padding-left: 18px !important;
  padding-bottom: 0 !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnImageCardBottomImageContent] {
  padding-bottom: 9px !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnImageCardTopImageContent] {
  padding-top: 18px !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnImageCardLeftImageContent], td[class=mcnImageCardRightImageContent] {
  padding-right: 18px !important;
  padding-left: 18px !important;
  padding-bottom: 0 !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnImageCardBottomImageContent] {
  padding-bottom: 9px !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnImageCardTopImageContent] {
  padding-top: 18px !important;
}
}

@media only screen and (max-width: 480px) {
table[class=mcnCaptionLeftContentOuter] td[class=mcnTextContent], table[class=mcnCaptionRightContentOuter] td[class=mcnTextContent] {
  padding-top: 9px !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnCaptionBlockInner] table[class=mcnCaptionTopContent]:last-child td[class=mcnTextContent] {
  padding-top: 18px !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnBoxedTextContentColumn] {
  padding-left: 18px !important;
  padding-right: 18px !important;
}
}

@media only screen and (max-width: 480px) {
td[class=mcnTextContent] {
  padding-right: 18px !important;
  padding-left: 18px !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section template width
  @tip Make the template fluid for portrait or landscape view adaptability. If a fluid layout doesn\'t work for you, set the width to 300px instead.
  */
table[class=templateContainer] {
  /*@tab Mobile Styles
@section template width
@tip Make the template fluid for portrait or landscape view adaptability. If a fluid layout doesn\'t work for you, set the width to 300px instead.*/max-width: 600px !important;
  /*@editable*/width: 100% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section heading 1
  @tip Make the first-level headings larger in size for better readability on small screens.
  */
h1 {
  /*@editable*/font-size: 24px !important;
  /*@editable*/line-height: 125% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section heading 2
  @tip Make the second-level headings larger in size for better readability on small screens.
  */
h2 {
  /*@editable*/font-size: 20px !important;
  /*@editable*/line-height: 125% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section heading 3
  @tip Make the third-level headings larger in size for better readability on small screens.
  */
h3 {
  /*@editable*/font-size: 18px !important;
  /*@editable*/line-height: 125% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section heading 4
  @tip Make the fourth-level headings larger in size for better readability on small screens.
  */
h4 {
  /*@editable*/font-size: 16px !important;
  /*@editable*/line-height: 125% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section Boxed Text
  @tip Make the boxed text larger in size for better readability on small screens. We recommend a font size of at least 16px.
  */
table[class=mcnBoxedTextContentContainer] td[class=mcnTextContent], td[class=mcnBoxedTextContentContainer] td[class=mcnTextContent] p {
  /*@editable*/font-size: 18px !important;
  /*@editable*/line-height: 125% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section Preheader Visibility
  @tip Set the visibility of the email\'s preheader on small screens. You can hide it to save space.
  */
table[id=templatePreheader] {
  /*@editable*/display: block !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section Preheader Text
  @tip Make the preheader text larger in size for better readability on small screens.
  */
td[class=preheaderContainer] td[class=mcnTextContent], td[class=preheaderContainer] td[class=mcnTextContent] p {
  /*@editable*/font-size: 14px !important;
  /*@editable*/line-height: 115% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section Header Text
  @tip Make the header text larger in size for better readability on small screens.
  */
td[class=headerContainer] td[class=mcnTextContent], td[class=headerContainer] td[class=mcnTextContent] p {
  /*@editable*/font-size: 18px !important;
  /*@editable*/line-height: 125% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section Body Text
  @tip Make the body text larger in size for better readability on small screens. We recommend a font size of at least 16px.
  */
td[class=bodyContainer] td[class=mcnTextContent], td[class=bodyContainer] td[class=mcnTextContent] p {
  /*@editable*/font-size: 18px !important;
  /*@editable*/line-height: 125% !important;
}
}

@media only screen and (max-width: 480px) {
/*
  @tab Mobile Styles
  @section footer text
  @tip Make the body content text larger in size for better readability on small screens.
  */
td[class=footerContainer] td[class=mcnTextContent], td[class=footerContainer] td[class=mcnTextContent] p {
  /*@editable*/font-size: 14px !important;
  /*@editable*/line-height: 115% !important;
}
}

@media only screen and (max-width: 480px) {
td[class=footerContainer] a[class=utilityLink] {
  display: block !important;
}
}
</style>
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
<center>
  <table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
    <tr>
      <td align="center" valign="top" id="bodyCell"><!-- BEGIN TEMPLATE // -->
        
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td align="center" valign="top"><!-- BEGIN PREHEADER // -->
              
              <table border="0" cellpadding="0" cellspacing="0" width="100%" id="templatePreheader">
                <tr>
                  <td align="center" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="600" class="templateContainer">
                      <tr>
                        <td valign="top" class="preheaderContainer" style="padding-top:9px;"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnTextBlock">
                            <tbody class="mcnTextBlockOuter">
                              <tr>
                                <td valign="top" class="mcnTextBlockInner"><table align="left" border="0" cellpadding="0" cellspacing="0" width="366" class="mcnTextContentContainer">
                                    <tbody>
                                      <tr>
                                        <td valign="top" class="mcnTextContent" style="padding-top:9px; padding-left:18px; padding-bottom:9px; padding-right:0;"><a href="http://www.facecake.com" target="_blank"><img align="none" height="48" src="http://cache.facecake.com/prod/tlc/img/email/fc_logo.png" style="width: 210px; height: 48px; margin: 0px;" width="210"></a></td>
                                      </tr>
                                    </tbody>
                                  </table>
                                  <table align="right" border="0" cellpadding="0" cellspacing="0" width="197" class="mcnTextContentContainer">
                                    <tbody>
                                      <tr>
                                        <td valign="top" class="mcnTextContent" style="padding-top:9px; padding-right:18px; padding-bottom:9px; padding-left:0;"></td>
                                      </tr>
                                    </tbody>
                                  </table></td>
                              </tr>
                            </tbody>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
              
              <!-- // END PREHEADER --></td>
          </tr>
          <tr>
            <td align="center" valign="top"><!-- BEGIN HEADER // -->
              
              <table border="0" cellpadding="0" cellspacing="0" width="100%" id="templateHeader">
                <tr>
                  <td align="center" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="600" class="templateContainer">
                      <tr>
                        <td valign="top" class="headerContainer" style="padding-top:10px; padding-bottom:10px;"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnImageBlock">
                            <tbody class="mcnImageBlockOuter">
                              <tr>
                                <td valign="top" style="padding:9px" class="mcnImageBlockInner"><table align="left" width="100%" border="0" cellpadding="0" cellspacing="0" class="mcnImageContentContainer">
                                    <tbody>
                                      <tr>
                                        <td class="mcnImageContent" valign="top" style="padding-right: 9px; padding-left: 9px; padding-top: 0; padding-bottom: 0; text-align:center;"><a href="'. $productURL .'" title="" class="" target="_blank"> <img align="center" alt="" src="' . $imgName . '" width="564" style="max-width:640px; padding-bottom: 0; display: inline !important; vertical-align: bottom;" class="mcnImage"> </a></td>
                                      </tr>
                                    </tbody>
                                  </table></td>
                              </tr>
                            </tbody>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
              
              <!-- // END HEADER --></td>
          </tr>
          <tr>
            <td align="center" valign="top"><!-- BEGIN BODY // -->
              
              <table border="0" cellpadding="0" cellspacing="0" width="100%" id="templateBody">
                <tr>
                  <td align="center" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="600" class="templateContainer">
                      <tr>
                        <td valign="top" class="bodyContainer" style="padding-top:10px; padding-bottom:10px;"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnTextBlock">
                            <tbody class="mcnTextBlockOuter">
                              <tr>
                                <td valign="top" class="mcnTextBlockInner"><table align="left" border="0" cellpadding="0" cellspacing="0" width="600" class="mcnTextContentContainer">
                                    <tbody>
                                      <tr>
                                        <td valign="top" class="mcnTextContent" style="padding-top:9px; padding-right: 18px; padding-bottom: 9px; padding-left: 18px;"><h1>Hi, ' . $toName . '</h1>
                                          <h3>I just tried on this NARS lipstick.&nbsp;&nbsp;<a href="'. $productURL .'">Click to try for yourself.</a></h3>
                                          <p>' . $message . '</p></td>
                                      </tr>
                                    </tbody>
                                  </table></td>
                              </tr>
                            </tbody>
                          </table>
                          <table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnFollowBlock">
                            <tbody class="mcnFollowBlockOuter">
                              <tr>
                                <td align="center" valign="top" style="padding:9px" class="mcnFollowBlockInner"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnFollowContentContainer">
                                    <tbody>
                                      <tr>
                                        <td align="center" style="padding-left:9px;padding-right:9px;"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnFollowContent">
                                            <tbody>
                                              <tr>
                                                <td align="center" valign="top" style="padding-top:9px; padding-right:9px; padding-left:9px;"><table border="0" cellpadding="0" cellspacing="0">
                                                    <tbody>
                                                      <tr>
                                                        <td valign="top"><table align="left" border="0" cellpadding="0" cellspacing="0" class="mcnFollowStacked">
                                                            <tbody>
                                                              <tr>
                                                                <td align="center" valign="top" class="mcnFollowIconContent" style="padding-right:10px; padding-bottom:5px;"><a href="https://www.facebook.com/FaceCakeMarketing" target="_blank"><img src="http://cdn-images.mailchimp.com/icons/social-block-v2/color-facebook-96.png" alt="Facebook" class="mcnFollowBlockIcon" width="48" style="width:48px; max-width:48px; display:block;"></a></td>
                                                              </tr>
                                                              <tr>
                                                                <td align="center" valign="top" class="mcnFollowTextContent" style="padding-right:10px; padding-bottom:9px;"><a href="https://www.facebook.com/FaceCakeMarketing" target="_blank" style="color: #606060;font-family: Arial;font-size: 11px;font-weight: normal;line-height: 100%;text-align: center;text-decoration: none;">Facebook</a></td>
                                                              </tr>
                                                            </tbody>
                                                          </table>
                                                          
                                                          <!--[if gte mso 6]>
                </td>
                  <td align="left" valign="top">
                <![endif]-->
                                                          
                                                          <table align="left" border="0" cellpadding="0" cellspacing="0" class="mcnFollowStacked">
                                                            <tbody>
                                                              <tr>
                                                                <td align="center" valign="top" class="mcnFollowIconContent" style="padding-right:10px; padding-bottom:5px;"><a href="https://twitter.com/facecake" target="_blank"><img src="http://cdn-images.mailchimp.com/icons/social-block-v2/color-twitter-96.png" alt="Twitter" class="mcnFollowBlockIcon" width="48" style="width:48px; max-width:48px; display:block;"></a></td>
                                                              </tr>
                                                              <tr>
                                                                <td align="center" valign="top" class="mcnFollowTextContent" style="padding-right:10px; padding-bottom:9px;"><a href="https://twitter.com/facecake" target="_blank" style="color: #606060;font-family: Arial;font-size: 11px;font-weight: normal;line-height: 100%;text-align: center;text-decoration: none;">Twitter</a></td>
                                                              </tr>
                                                            </tbody>
                                                          </table>
                                                          
                                                          <!--[if gte mso 6]>
                </td>
                  <td align="left" valign="top">
                <![endif]-->
                                                          
                                                          <table align="left" border="0" cellpadding="0" cellspacing="0" class="mcnFollowStacked">
                                                            <tbody>
                                                              <tr>
                                                                <td align="center" valign="top" class="mcnFollowIconContent" style="padding-right:0; padding-bottom:5px;"><a href="http://www.facecake.com" target="_blank"><img src="http://cdn-images.mailchimp.com/icons/social-block-v2/color-link-96.png" alt="Website" class="mcnFollowBlockIcon" width="48" style="width:48px; max-width:48px; display:block;"></a></td>
                                                              </tr>
                                                              <tr>
                                                                <td align="center" valign="top" class="mcnFollowTextContent" style="padding-right:0; padding-bottom:9px;"><a href="http://www.facecake.com" target="_blank" style="color: #606060;font-family: Arial;font-size: 11px;font-weight: normal;line-height: 100%;text-align: center;text-decoration: none;">Website</a></td>
                                                              </tr>
                                                            </tbody>
                                                          </table>
                                                          
                                                          <!--[if gte mso 6]>
                </td>
                  <td align="left" valign="top">
                <![endif]--></td>
                                                      </tr>
                                                    </tbody>
                                                  </table></td>
                                              </tr>
                                            </tbody>
                                          </table></td>
                                      </tr>
                                    </tbody>
                                  </table></td>
                              </tr>
                            </tbody>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
              
              <!-- // END BODY --></td>
          </tr>
          <tr>
            <td align="center" valign="top"><!-- BEGIN FOOTER // -->
              
              <table border="0" cellpadding="0" cellspacing="0" width="100%" id="templateFooter">
                <tr>
                  <td align="center" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="600" class="templateContainer">
                      <tr>
                        <td valign="top" class="footerContainer" style="padding-top:10px; padding-bottom:10px;"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="mcnTextBlock">
                            <tbody class="mcnTextBlockOuter">
                              <tr>
                                <td valign="top" class="mcnTextBlockInner"><table align="left" border="0" cellpadding="0" cellspacing="0" width="600" class="mcnTextContentContainer">
                                    <tbody>
                                      <tr>
                                        <td valign="top" class="mcnTextContent" style="padding-top:9px; padding-right: 18px; padding-bottom: 9px; padding-left: 18px;"><em>Copyright &copy; ' . date("Y") . ' FaceCake Marketing Technologies, Inc.</em><em>, All rights reserved.</em><br>
                                          <br>
                                          <strong>Contact us:</strong><br>
                                          <a href="mailto:info@facecake.com">info@facecake.com</a><br>
                                          <br>
                                          <a href="http://www.facecake.com/privacy.html">PRIVACY POLICY</a></td>
                                      </tr>
                                    </tbody>
                                  </table></td>
                              </tr>
                            </tbody>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
              
              <!-- // END FOOTER --></td>
          </tr>
        </table>
        
        <!-- // END TEMPLATE --></td>
    </tr>
  </table>
</center>
</body>
</html>';
  

      if(!$mail->send()) {
          echo '<h1>Message could not be sent.';
          echo 'Mailer Error: ' . $mail->ErrorInfo;
          echo '</h1>';
      } else {
          echo("<h1>Email Sent</h1>");
      }
    }
  ?>