-3

So, I have a PHP script and it basically sends an email when you unsubscribe. The code is fine and so I inputted it into my PHP, but it only sends part of it. Here is a JSFiddle of what it should be. This isn't very clean because this is the HTML of an email, but that isn't the point. So I have my email code, and I can run it and see that it works perfectly and runs the email just how I want it to. I have my PHP tested too. It sends me an email and I have tested it before, which allows me to know that it actually does send what is requested. Here is my PHP code:

<?php
  $to = 'example@example.com';

  $subject = 'Sorry To See You Go!';

  $headers = "From: example@example.com" . strip_tags($_POST['req-email']) . "\r\n";
  $headers .= "Reply-To: example@example.com". strip_tags($_POST['req-email']) . "\r\n";
  $headers .= "CC: example@example.com\r\n";
  $headers .= "MIME-Version: 1.0\r\n";
  $headers .= "Content-Type: text/html; charset=UTF-8\r\n";

  $message .= '<table align="center" border="0" cellpadding="0" cellspacing="0" class="main-width" width="630" style="border-collapse: collapse; table-layout: fixed; font-family: &quot;Times New Roman&quot;; font-size: medium; width: 630px;"><tbody><tr><td align="center" class="layout" valign="top" style="padding: 15px 5px;"><table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed;"><tbody><tr><td align="center" bgcolor="#4C4C4C" class="layout-container-border" valign="top" style="background: rgb(76, 76, 76); padding: 10px;"><table align="center" bgcolor="#4C4C4C" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><tbody><tr><td align="center" bgcolor="#FFFFFF" class="layout-container" valign="top" style="background: rgb(255, 255, 255); padding: 0px;"><div class=""><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="logo OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-image"><table border="0" cellpadding="0" cellspacing="0" class="editor-image logo-container editor-image-vspace-on" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="center" valign="top" style="padding-bottom: 10px; padding-top: 10px;"><div class="publish-container"><a href="http://html-hub.net16.net/" target="_blank" style="text-decoration-line: underline;"><img alt="" border="0" class="" hspace="0" src="http://files.constantcontact.com/69a6c42a601/8b94df2c-ed2c-40ea-ad5d-12bd5a1f8eab.png" vspace="0" width="197" style="display: block;"></a></div></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-text"><table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="editor-text editor-text " valign="top" style="-webkit-font-smoothing: antialiased; color: rgb(64, 63, 66); display: block; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; padding: 10px 20px; word-wrap: break-word;"><div></div><div><div align="center" style="text-align: center;">&nbsp;&nbsp;<span style="color: rgb(71, 155, 70); font-size: 24px; font-weight: bold;">Sorry To See You Go!</span></div></div></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-divider"><table border="0" cellpadding="0" cellspacing="0" class="editor-divider" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="center" class="" valign="top"><table class="galileo-ap-content-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; cursor: default; min-width: 100%;"><tbody><tr><td align="center" class="divider-base divider-solid" valign="top" width="100%" style="padding: 9px 0px 10px;"><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; table-layout: fixed; height: 1px; min-width: 95%; width: 570.4px;"><tbody><tr><td align="center" bgcolor="rgb(69, 179, 202)" height="1" style="background: rgb(69, 179, 202); border-bottom-style: none; height: 1px; line-height: 1px; padding-bottom: 4px;"><img alt="" border="0" height="1" hspace="0" src="https://imgssl.constantcontact.com/letters/images/1101116784221/S.gif" vspace="0" width="5" style="display: block; height: 1px; width: 5px;"></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-text"><table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="editor-text editor-text " valign="top" style="-webkit-font-smoothing: antialiased; color: rgb(64, 63, 66); display: block; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; padding: 10px 20px; word-wrap: break-word;"><div></div><div><div align="center" style="text-align: center;"><div>&nbsp;<span style="font-size: 18px;">At CyanCoding, we try out best to present our users with easy accessibility, fun programs, and a quality website. We think you made a mistake by unsubscribing, but you are the boss! You will no longer receive emails stating new programs, updates, or other news.</span><br></div><br></div></div></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-divider"><table border="0" cellpadding="0" cellspacing="0" class="editor-divider" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="center" class="" valign="top"><table class="galileo-ap-content-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; cursor: default; min-width: 100%;"><tbody><tr><td align="center" class="divider-base divider-solid" valign="top" width="100%" style="padding: 9px 0px 10px;"><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; table-layout: fixed; height: 1px; min-width: 95%; width: 570.4px;"><tbody><tr><td align="center" bgcolor="rgb(69, 179, 202)" height="1" style="background: rgb(69, 179, 202); border-bottom-style: none; height: 1px; line-height: 1px; padding-bottom: 4px;"><img alt="" border="0" height="1" hspace="0" src="https://imgssl.constantcontact.com/letters/images/1101116784221/S.gif" vspace="0" width="5" style="display: block; height: 1px; width: 5px;"></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-text"><table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="editor-text editor-text " valign="top" style="-webkit-font-smoothing: antialiased; color: rgb(64, 63, 66); display: block; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; padding: 10px 20px; word-wrap: break-word;"><div></div><div><div align="center" style="text-align: center;"><span style="font-size: 14px;">If you believe this to be a mistake, please click the button below.</span></div></div></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-button"><table border="0" cellpadding="0" cellspacing="0" class="editor-button" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%; width: 600.8px;"><tbody><tr><td class="editor-button-container editor-button-container " style="color: rgb(255, 255, 255); font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 14px; padding: 10px 20px;"><table class="galileo-ap-content-editor" style="border-collapse: collapse; table-layout: fixed; min-width: 100%; width: 560.8px;"><tbody><tr><td align="center" class="MainTextFullWidthTD" valign="top" style="font-family: Arial, Verdana, Helvetica, sans-serif; padding: 0px;"><table bgcolor="#4C4C4C" border="0" cellpadding="0" cellspacing="0" class="" style="border-collapse: collapse; table-layout: fixed; background: rgb(76, 76, 76); border-spacing: 0px; border: none; min-width: initial; padding: 0px; width: initial;"><tbody><tr><td align="center" class="MainTextFullWidthTD" valign="top" style="font-family: Arial, Verdana, Helvetica, sans-serif; padding: 9px 15px 10px;"><div class="MainTextFullWidth" style="-webkit-font-smoothing: antialiased;"><a href="http://cyancoding.net16.net/subscribe.html" target="_blank" style="color: rgb(255, 255, 255);">Subscribe</a></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" bgcolor="#4C4C4C" class="about OneColumnMobile column" valign="top" width="100%" style="background: rgb(76, 76, 76);"><div class="gl-contains-text"><table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="editor-text about-text" valign="top" style="-webkit-font-smoothing: antialiased; color: rgb(255, 255, 255); display: block; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; padding: 10px 20px; text-align: center; word-wrap: break-word;"><div></div><div><a href="mailto:skyecam21@gmail.com" target="_blank" style="text-decoration-line: underline; color: rgb(106, 194, 213);">Email</a>&nbsp;|&nbsp;<a href="http://cyancoding.net16.net/" target="_blank" style="text-decoration-line: underline; color: rgb(106, 194, 213);">Website</a>&nbsp;|&nbsp;<a href="http://cyancoding.net16.net/subscribe.html" target="_blank" style="text-decoration-line: underline; color: rgb(106, 194, 213);">Subscribe</a></div></td></tr></tbody></table></div></td></tr></tbody></table></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><span></span>';


  mail($to, $subject, $message, $headers);
?>

P.S I would fill in an email address for where it says example@example.com

So, if you run this, here is the result email:

Email error

This isn't right at all! As we can see, this is far from the JSFiddle we saw earlier.

I want the PHP to send the email just like how the HTML appears. Here is the email code in a snippet if it helps:

<table align="center" border="0" cellpadding="0" cellspacing="0" class="main-width" width="630" style="border-collapse: collapse; table-layout: fixed; font-family: &quot;Times New Roman&quot;; font-size: medium; width: 630px;"><tbody><tr><td align="center" class="layout" valign="top" style="padding: 15px 5px;"><table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed;"><tbody><tr><td align="center" bgcolor="#4C4C4C" class="layout-container-border" valign="top" style="background: rgb(76, 76, 76); padding: 10px;"><table align="center" bgcolor="#4C4C4C" border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><tbody><tr><td align="center" bgcolor="#FFFFFF" class="layout-container" valign="top" style="background: rgb(255, 255, 255); padding: 0px;"><div class=""><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="logo OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-image"><table border="0" cellpadding="0" cellspacing="0" class="editor-image logo-container editor-image-vspace-on" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="center" valign="top" style="padding-bottom: 10px; padding-top: 10px;"><div class="publish-container"><a href="http://html-hub.net16.net/" target="_blank" style="text-decoration-line: underline;"><img alt="" border="0" class="" hspace="0" src="http://files.constantcontact.com/69a6c42a601/8b94df2c-ed2c-40ea-ad5d-12bd5a1f8eab.png" vspace="0" width="197" style="display: block;"></a></div></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-text"><table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="editor-text editor-text " valign="top" style="-webkit-font-smoothing: antialiased; color: rgb(64, 63, 66); display: block; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; padding: 10px 20px; word-wrap: break-word;"><div></div><div><div align="center" style="text-align: center;">&nbsp;&nbsp;<span style="color: rgb(71, 155, 70); font-size: 24px; font-weight: bold;">Sorry To See You Go!</span></div></div></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-divider"><table border="0" cellpadding="0" cellspacing="0" class="editor-divider" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="center" class="" valign="top"><table class="galileo-ap-content-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; cursor: default; min-width: 100%;"><tbody><tr><td align="center" class="divider-base divider-solid" valign="top" width="100%" style="padding: 9px 0px 10px;"><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; table-layout: fixed; height: 1px; min-width: 95%; width: 570.4px;"><tbody><tr><td align="center" bgcolor="rgb(69, 179, 202)" height="1" style="background: rgb(69, 179, 202); border-bottom-style: none; height: 1px; line-height: 1px; padding-bottom: 4px;"><img alt="" border="0" height="1" hspace="0" src="https://imgssl.constantcontact.com/letters/images/1101116784221/S.gif" vspace="0" width="5" style="display: block; height: 1px; width: 5px;"></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-text"><table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="editor-text editor-text " valign="top" style="-webkit-font-smoothing: antialiased; color: rgb(64, 63, 66); display: block; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; padding: 10px 20px; word-wrap: break-word;"><div></div><div><div align="center" style="text-align: center;"><div>&nbsp;<span style="font-size: 18px;">At CyanCoding, we try out best to present our users with easy accessibility, fun programs, and a quality website. We think you made a mistake by unsubscribing, but you are the boss! You will no longer receive emails stating new programs, updates, or other news.</span><br></div><br></div></div></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-divider"><table border="0" cellpadding="0" cellspacing="0" class="editor-divider" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="center" class="" valign="top"><table class="galileo-ap-content-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; cursor: default; min-width: 100%;"><tbody><tr><td align="center" class="divider-base divider-solid" valign="top" width="100%" style="padding: 9px 0px 10px;"><table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse; table-layout: fixed; height: 1px; min-width: 95%; width: 570.4px;"><tbody><tr><td align="center" bgcolor="rgb(69, 179, 202)" height="1" style="background: rgb(69, 179, 202); border-bottom-style: none; height: 1px; line-height: 1px; padding-bottom: 4px;"><img alt="" border="0" height="1" hspace="0" src="https://imgssl.constantcontact.com/letters/images/1101116784221/S.gif" vspace="0" width="5" style="display: block; height: 1px; width: 5px;"></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-text"><table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="editor-text editor-text " valign="top" style="-webkit-font-smoothing: antialiased; color: rgb(64, 63, 66); display: block; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; padding: 10px 20px; word-wrap: break-word;"><div></div><div><div align="center" style="text-align: center;"><span style="font-size: 14px;">If you believe this to be a mistake, please click the button below.</span></div></div></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="" class="OneColumnMobile column" valign="top" width="100%"><div class="gl-contains-button"><table border="0" cellpadding="0" cellspacing="0" class="editor-button" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%; width: 600.8px;"><tbody><tr><td class="editor-button-container editor-button-container " style="color: rgb(255, 255, 255); font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 14px; padding: 10px 20px;"><table class="galileo-ap-content-editor" style="border-collapse: collapse; table-layout: fixed; min-width: 100%; width: 560.8px;"><tbody><tr><td align="center" class="MainTextFullWidthTD" valign="top" style="font-family: Arial, Verdana, Helvetica, sans-serif; padding: 0px;"><table bgcolor="#4C4C4C" border="0" cellpadding="0" cellspacing="0" class="" style="border-collapse: collapse; table-layout: fixed; background: rgb(76, 76, 76); border-spacing: 0px; border: none; min-width: initial; padding: 0px; width: initial;"><tbody><tr><td align="center" class="MainTextFullWidthTD" valign="top" style="font-family: Arial, Verdana, Helvetica, sans-serif; padding: 9px 15px 10px;"><div class="MainTextFullWidth" style="-webkit-font-smoothing: antialiased;"><a href="http://cyancoding.net16.net/subscribe.html" target="_blank" style="color: rgb(255, 255, 255);">Subscribe</a></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></div></td></tr></tbody></table><table border="0" cellpadding="0" cellspacing="0" class="galileo-ap-layout-editor" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" bgcolor="#4C4C4C" class="about OneColumnMobile column" valign="top" width="100%" style="background: rgb(76, 76, 76);"><div class="gl-contains-text"><table border="0" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; table-layout: fixed; min-width: 100%;"><tbody><tr><td align="left" class="editor-text about-text" valign="top" style="-webkit-font-smoothing: antialiased; color: rgb(255, 255, 255); display: block; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px; padding: 10px 20px; text-align: center; word-wrap: break-word;"><div></div><div><a href="mailto:skyecam21@gmail.com" target="_blank" style="text-decoration-line: underline; color: rgb(106, 194, 213);">Email</a>&nbsp;|&nbsp;<a href="http://cyancoding.net16.net/" target="_blank" style="text-decoration-line: underline; color: rgb(106, 194, 213);">Website</a>&nbsp;|&nbsp;<a href="http://cyancoding.net16.net/subscribe.html" target="_blank" style="text-decoration-line: underline; color: rgb(106, 194, 213);">Subscribe</a></div></td></tr></tbody></table></div></td></tr></tbody></table></div></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><span></span>

EDIT: The reason that this wasn't working, is because my mail server wasn't executing part of the code. I did however fix this.

CyanCoding
  • 1,012
  • 1
  • 12
  • 35
  • Start by removing the dot in this `$message .=` since I don't see any other declaration before that. – Funk Forty Niner Jul 26 '17 at 15:50
  • The way it gets rendered depends on the email client used. What are you receiving it on (e.g. Gmail, Outlook)? – Andy Jul 26 '17 at 15:50
  • I would also say - add a `Content-Length` header. – t1gor Jul 26 '17 at 15:51
  • where is the other `$message` that you are appending to here `$message .=` – Masivuye Cokile Jul 26 '17 at 15:51
  • I would also say get rid of the "We think you made a mistake" unless you want your customers to be completely sure they did the right thing. – Jonnix Jul 26 '17 at 15:51
  • This is a very basic email that is more of a test rather than something that is going to be published. I would rather not have criticism about the contents of it. If you are going to suggest something, please put it in answer form. – CyanCoding Jul 26 '17 at 15:53
  • *"please put it in answer form"* - meaning what exactly? @CyanCoding Down below? no, I won't, question's unclear. I posted [a comment up there](https://stackoverflow.com/questions/45331815/php-is-only-sending-part-of-the-email#comment77625460_45331815) first, yet you answer to another that you say are criticizing your post. I don't get it. – Funk Forty Niner Jul 26 '17 at 15:54
  • @CyanCoding instead of worrying about peoples feedback maybe address the issues. As pointed out `$message .=` is wrong because you're not appending to an existing variable (which is what `.=` does). Secondly, this is a display/rendering problem and it depends what email client you're using the recieve the mail as to exactly how things are rendered. If you're sending it to Gmail, for example, try with a Hotmail/Outlook address and see if you get the same results. Rendering email has always been somewhat tricky as clients don't use CSS in the same way as browsers. – Andy Jul 26 '17 at 15:56
  • You also should be addressing @JonStirling about your comment *"I would rather not have criticism about the contents of it."*. We don't know if he's stil in the question or not. – Funk Forty Niner Jul 26 '17 at 15:57
  • If I wasn't I am now. I'm wondering about what looks like a space between `<` and `tbody`, but that could be weirdness. – Jonnix Jul 26 '17 at 15:58

2 Answers2

0

As fred have stated that remove $message .= the dot and I asked

where is the other $message that you are appending to here $message .= AS it stands you have :

Notice: Undefined variable: message in on line 12

therefore change $message .= "...";

to

$message = "..."

Then you will get the results

enter image description here

Masivuye Cokile
  • 4,754
  • 3
  • 19
  • 34
0

try to add "Content-Transfer-Encoding: base64\r\n" param for remove chars limit

mail($to, $subject, chunk_split(base64_encode($message), "Content-Transfer-Encoding: base64\r\n");
Fil0z0
  • 203
  • 1
  • 8