How to stop css embedded in an email affecting the whole page - html

My web application records emails sent from third party applications such as Outlook in a timeline using the maillin node.js framework. It all works as intended with one major problem. When a user clicks on an email to view it, the css embedded in the email affects the whole page. I know I could get around this by opening the email in an iframe, or just loading the text. But I was just wondering if there was any other way to isolate the css and stop it infecting the page.
Edit.
I should have mentioned the the main application is C# .Net MVC

I solved this by converting the email to an image, I have a licence for a commercial application that converts html to an image (I won't advertise it), and at the end of the day users just need to see the email. Thanks for your responses anyway.

Related

ASP.NET Core read HTML email and display in webapp

I am working on a custom email webapp for my company. I have browsed the web and can't find an exact answer. Maybe I don't know what to "google" for exactly. I have never done anything email related.
In our database we are saving emails as a string. It contains everything.
<DOCTYPE><head><body><style> etc. How would I go about displaying this in my webapp.
I tried just pasting the HTML in a <div> inside one of my components but the styles would not load properly.
How would I go about reading/parsing the raw HTML in the string to then display it in my webapp. Is there a nuget package anyone recommends.
I am using Blazor on .net core 5.
As you may have found, putting an email HTML body into an existing web page will almost result in CSS pollution as the HTML may have styles (or may use styles from the web page).
My solution to this was to load and display the email HTML inside an <iframe> tag as this isolates the email from the page very effectively. The URL for the IFRAME is separate view on the server, which just returns the raw email HTML (remember to add security to this if needed in your app).
There are probably better ways to do this in CSS now without having to resort to IFRAME.

How is SMTPJS for sending e-mails with only HTML pages?

How feasible is https://smtpjs.com/ to integrate with HTML page to send e-mail via contact form module. I am working with one HTML page and need to integrate the e-mail services.
Seems its free, but any thing need to be include in the page for the courtesy or anything else. guide me

Alternative to mailto: to link email

I am creating a website and there is a page with people that are part of the company. Each person has an email that i want for the user to be able to get the email for the person that he/she want.
If we were in 2011 i would have used mailto: html tag. But really not so many people are using desktop email clients.
I thought about linking to a link so a new window would open in gmail and a new message would be created with recepient the pressed email. BUT not everyone uses gmail.
The only posible "solution" that i though that when the user clicks on the email this would be copied automatically in the clipboard. It would have the same result as doing CTRL & C at something. BUT this requires a lot of time and i dont want to get my hands dirty with javascript.
Is there any other way to do this ?
You should probably still use mailto:. mailto: is not intended for just desktops, it identifies a handler for the client. A mobile device would be able to recognize it just as well, and launch its preferred MTU.
With a lot of addons like smartaddon contact form and foxyform available out there, you could add them to your html code.
But, if you could use php, it to would just take few statements of code to set up the contact form on your own. Refer this post which explains clearly on how to set up your contact form using php.

Metro App mailto protocol doesn't accept HTML?

I am trying to make a metro app which involves the user sending out an invitation email to friends. To do this, I am using the mailto:// protocol. However, if I try to include HTML tags in the body section, the Mail app reads them literally and displays raw HTML to the user. Is there any way to get around this?
All help is greatly appreciated and I always accept an answer!
I'm currently hunting for an answer to a similar problem, only in my case I also want to embed an image in the body of the email. I have not dug into the code much, but it seems like the Mail app does not handle all the protocols required to attach additional files to the html body. For the simple case though - you should be able to share your html being the share source and invoking the share charm. You are not limiting the user from using other applications as share targets for your html and you probably can't define the subject or recipients, but it's the best I could find.
There is a sample you can check here: "Sharing content source app sample".

Add a new mailid in outlook by clicking on email id in a mail body

I want to generate a mail body in which i want to make a link, on which user clicks and add new contact outlook popup opens into the client screen.
How this can be done??
This is what vCard was invented for. Create a vCard file (from Outlook or using a third party application), and host it online on some webspace. Or, if needed, you can create a webpage that generates the vCard dynamically. Simply add a hyperlink to the vCard URL to the email message body.
Upon clicking upon the URL, Outlook will open up the contents from the vCard as a new Outlook contact.
That is, if Outlook isn't setup to block URLs, in which case you'd be better off sending the vCard as an attachment. Outlook signatures can be setup to contain a vCard.
I'm afraid this will most likely turn out to be impossible. Scripting is usually taboo in E-Mail clients.
This may be possible from within a web site using IE specific scripting (in VBScript, connecting to Outlook via COM or something), but security settings would block that from working for the vast majority of users anyway.