0

I have setup a basic email marketing program using php based on the mailgun api. Now whenever I send emails from the program, all the double quotes in the inline CSS of the HTML email get escaped. So I end up with an ugly html email with the table borders and the text showing up and not much else.

But when I try sending the exact same html email through the same program through my localhost, the email with proper html formatting and CSS gets delivered.

Why is this happening? How do I solve this?

<table align="center" cellpadding="0" cellspacing="0" style="background:#efefef; height:auto; width:100%">

On my hosted website, the above gets displayed as follows:

<table align=\"center\" cellpadding=\"0\" cellspacing=\"0\" style=\"background:#efefef; height:auto; width:100%\">

But, when I send the same email through my localhost, there is no problem.

Any help would be appreciated. Thanks a ton.

Dexxterr
  • 59
  • 8

1 Answers1

0

I haven't used it myself, but it looks like there are some tricks to using Mailgun. One of them seems to be to...

3. use stripslashes() to escape data before trying to send it (HTML, anyways).

Source: Sending an email through Mailgun with PHP (Part 2)

benomatis
  • 5,536
  • 7
  • 36
  • 59