HTML Email

Hi people!

I’ve designed an HTML Email that will be used as a newsletter. The layout works perfectly and have tested it even in Gmail, which is known to ignore certain styling elements so I’m happy with that.

The part that I am struggling with is some dynamic content. I have created a PHP script that checks my website for recent articles and displays the 5 most recent articles in a box within this newsletter.

It works perfectly when viewed as a web page but in some email clients, it doesn’t display at all - I’ve tried using <iframes> but I found out later that a lot of email clients strip these from the HTML. I’ve also tried using <object> and <embed> but none of them work - they all get stripped from the HTML particularly with Gmail.

Does anybody know of a way to embed this PHP file into the HTML email where it will not be stripped?


Sorry, you can’t. Treat the HTML newsletter as a static document. Maybe include a link that says “check here for updates”.

Because of the limitations imposed on HTML email, you can forget about javascript (ie, parsing an RSS feed), anything beyond very basic CSS, and embedding anything (as you found out), you’ll have to code the newsletter like it’s 1998 again with table layouts and <font> tags.

And be sure to include a text version for email clients to fall back on…not all of them will even interpret HTML.

Wow, that’s very disappointing.

I had suspected this was the case. The only thing that confuses me is if this is the case, how do these websites that offer you a daily horoscope by email manage this… I mean this has to be RSS based - surely they don’t sit down every day and write all of these horoscopes manually.

Usually when organizations send out regular newsletters/email, they have a template in their mailing list management tool, so they just plug in the text they want, and off it goes.

Yeah this is the answer I keep coming back to and it still eludes me as to how exactly I can get that content to “plug in” to the newsletter.

I have the template but I cannot seem to work out how to import the content into it.

I have been told that I could use a PHP Script to fetch the content and drop it into a database, which I can do comfortably. But that still leaves me with the question of How do I then get the email to fetch the data from the database.

I’ve seen organisations send these mails out. I figured this would be the best place to find someone who knew how it was done. Surely it can’t be impossible.

Depending on the mailing list system being used, you can either create your own template with defined variables, or create your own script to generate the HTML code for the newsletter which is just copied & pasted into the mailing list system.

I’m using a service called MyNewsletterBiulder. The sending is all automated and setup through their interface and all I do is create the actual newsletter content. I can either use one of their pre-built templates or I can put in my own Raw HTML.

What do you mean by defined variables? Can somebody please give me an example?


The software you’re using probably doesn’t support user-defined variables. At least, I didn’t see any indication as such from the demo video I looked at.

A defined variable would just be a placeholder in a template. Then, when you fill out a corresponding field, it would automatically put your content in the template and generate the HTML. But–the software you’re using handles this differently.

It looks like you would have to build a separate script to generate the content you want and then paste it into the template editor.

Hi and thanks again for replying…

It looks like you would have to build a separate script to generate the content you want and then paste it into the template editor.

This takes me back to my first post. I have built the script that generates the content… This is what I’m trying to paste into the template editor but I don’t know how. I could really do with an example.

Copy & paste into an editable area. Beyond that…you’ll probably have to contact support. I am not familiar with the specifics of the software you’re using.