title: How to fix message not shown in email activation
body: <p>I can't seem to get my email activation message to be sent in my new host called infinity-free.</p>
  
  <p>I tried to use phpmailer as well as the mail function but can't see my html content.</p>
  
  <pre><code>$to = $email;
  
  //sender
  $from = 'pianocourse101@hotmail.com';
  $fromName = 'PianoCourse101';
  
  //email subject
  $subject = 'Activate your Primer Level Membership Plan!';
  
  //attachment file path
  $file = "codexworld.pdf";
  
  //email body content
  $htmlContent = "&lt;h1&gt;Activate your Primer Level Membership Plan!&lt;/h1&gt;
                                                                                &lt;p&gt;Dear $first $last, &lt;br /&gt;Thank you for registering your Primer Level Membership Plan with PianoCourse101! You are receiving this e-mail because you or someone else claiming to be you has selected a Primer Level Membership Plan \n\nIf you believe that this is a mistake, please send us a ticket with the subject \"How to cancel my Primer Level Membership Plan?\" and allow at least 48 hours before receiving a reply.\n\nHowever, if this is correct, then you must activate your Primer Level Membership Plan by clicking on the link below: \n\n &lt;a href=https://www.pianocourse101.com/activate.php?email=".htmlspecialchars($to)."&amp;activatetoken=".htmlspecialchars($token4)."&gt;Click here to activate your Primer Level Membership Plan.&lt;/a&gt;\n\nAlternatively, you can use the following token to manually activate your Level 3 Yearly Membership Plan by clicking on the 'Activate Membership\s Section:' \n\nToken:.$token4;
                                                                            &lt;/p&gt;";
  
  //header for sender info
  $headers = "From: $fromName"." &lt;".$from."&gt;";
  
  //boundary 
  $semi_rand = md5(time());
  $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
  
  //headers for attachment 
  $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
  
  //multipart boundary 
  $message = "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"UTF-8\"\n" .
      "Content-Transfer-Encoding: 7bit\n\n" . $htmlContent . "\n\n";
  
  //preparing attachment
  if(!empty($file) &gt; 0){
      if(is_file($file)){
          $message .= "--{$mime_boundary}\n";
          $fp =    @fopen($file,"rb");
          $data =  @fread($fp,filesize($file));
  
          @fclose($fp);
          $data = chunk_split(base64_encode($data));
          $message .= "Content-Type: application/octet-stream; name=\"".basename($file)."\"\n" .
              "Content-Description: ".basename($file)."\n" .
              "Content-Disposition: attachment;\n" . " filename=\"".basename($file)."\"; size=".filesize($file).";\n" .
              "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
      }
  }
  $message .= "--{$mime_boundary}--";
  $returnpath = "-f" . $from;
  
  //send email
  $mail = mail($to, $subject, $message, $headers, $returnpath);
  
  //email sending status
  echo $mail?"&lt;h1&gt;Mail sent.&lt;/h1&gt;":"&lt;h1&gt;Mail sending failed.&lt;/h1
  
  &gt;";
  </code></pre>
  
  <p>I have also used phpmailer with similar contents but can't seem to get it send through.... </p>