Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Style-tag being removed in EPiServer Mail 7?



In EPiServer Mail 7 we have a mail-template with markup. Inside the markup we have a simple style-tag:

<style type="text/css">
/* ----- Styling ----- */

The mail also contains a link which lets the user view the mail on the web. To be able to view the message online, we use some code from the EPiServer Mail 7 API:

// Start dummy code

// Get hold of the message
Message message = EPiServerMailHandler.GetMessageByGuid(messageGuid);

// Get hold of the mail's markup
mailContent = new StringBuilder(message.BodyHtml);

// End dummy code

However when examining the source of the page, the style-tag has been removed. Can anyone explain why this is?

We implement the same code in EPiServer Mail 4.4 without having the style-tag removed.

Feb 07, 2014 15:29

That sounds a bit strange. Does the behavior change if you uncheck the "remove scripts" option when sending?

While that option is not supposed to remove style tags specifically (rather script, object and some things along those lines) it is the option that would pass the mail body through an html filter that is removing some things and I think that would be a good first troubleshooting step.

Feb 07, 2014 17:52

Thank you for your response, Håkan!

I can't seem to find the "remove scripts" option in EPiServer Mail 7. In EPiServer Mail 4.4 I know we had a radio button with that option.

I made a new mail and posted it, and now it seems like the style-tag is present again. Guess I have to wait and see if the problem occurs again.

Feb 10, 2014 15:12

This issue is now registered as a bug
Bug #113463: Style-tag being removed in EPiServer Mail 7
It will go through normail triage and then you can follow this on

Apr 03, 2014 13:20

Any solution to this yet?

Aug 19, 2014 10:55

The bug is fixed and a new package was built today. It will now be tested to verify the fix and then it can be sent out to partners requesting it.

In case you affected and like to have it sent over please contact Developer Support and we can provide the package as soon as the tests are finished.

Aug 19, 2014 15:33

I hope you haven't introduced any other bugs in EPiServer Mail 7. We're currently experiencing problems sending mail to certain e-mail addresses. It worked yesterday but not today...

Aug 19, 2014 16:00
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.