I'm currently working on sending emails using APIS in NodeJS. The issue I am facing is related to the CSS code with '%' symbols triggering errors when attempting to send the email via Postman, resulting in a 500 error. However, removing the '%' symbol from the code allows the email to be sent successfully.
Here's an example snippet of the problematic code:
{
"toAddress" : "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8beafeffe3e4f9a5efeeffeae2e7f8cbeef3eae6fbe7eea5e8e4e6">[email protected]</a>",
"subject" : "Test - Mail Server",
"body" : '<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="https://www.google.com/images/srpr/logo3w.png" alt="Image" title="Image" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 100%;max-width: 580px;" width="580"/>
</td>
</tr>
</table>',
"fromAddress" : "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="81e4f9e0ecf1ede4c1e4f9e0ecf1ede4afe2eeec">[email protected]</a>"
}
You can find the entire code here.
If you have any tips or suggestions on how to properly use '%' within the body of the email or if there are specific escape/parse methods needed, please feel free to share. Your assistance is greatly appreciated. Thank you for your time :)