html newsletter email arriving as an attachment - html

I'm using C# to send email newsletters for subscribers.
There's no problem with sending the email but some email clients like outlook and hotmail receive html newsletter as an attachment and the email body contains only plaintext with html tags removed and some clients like gmail receive the email just fine.
What actually creates this behavior? If i put just few html tags in to message outlook and hotmail shows the newsletter fine but as i put in more html elements my mail arrives as attachment.
I've been trying to find out how to make my email appear ok in most popular email clients like outlook but have had no success so far. Anyone care to enlighten me how this email + html stuff actually works?

Have a look at the Mailchimp and CampaignMonitor links in this answer, which may help you.

Since you don't provide any information about how you're using C# to send this email, we can only speculate about what you're doing and what the problem might be. It sounds like you might be using MailMessage.AlternateViews to send your HTML, but only have that one view. If you're not intending to send out a multipart/alternative message then you should simply set the MailMessage.Body to your HTML content with MailMessage.IsBodyHtml = true.
That being said: I make the assumptions I do because some email clients are smarter than others, and if the content-type header doesn't make sense they'll do their best to try to figure out what the nicest way to display the content is, each potentially trying something different. If, however, my assumptions are incorrect it would greatly help to know the code you're using to generate the email, and even an example of the message headers.

Related

Which tags should I specify for email HTML

If I send an HTML via email, should I still specify such tags like <!DOCTYPE html> and <head>?
Or should I just send the <body> content directly? Will most popular email clients display such image in the correct way?
It depends.
Every mail client is different, and every message is different, which is why the proper approach would be to perform testing on multiple clients before sending your message.
Back in my bulk mail days, I did extensive testing and even had different logic based on the recipient's domain. For example, using <div> in Gmail and <p> for Yahoo.
There's a good reason people pay for mail services like Constant Contact and Mail Chimp. It takes a lot of work to stay on top of these things.

HTML mailto Yahoo Mail with recipient name

I would like to add the names of the recipients in a html mailto link for Yahoo Mail users. I know that they can set Yahoo Mail as a default handler or mailto: links, but I have a particular use case where solving this could be helpful.
Currently, I already have a compose link that works:
https://compose.mail.yahoo.com/?to=john#doe.com
In particular I would like to be able format ?to=john#doe.com so that Yahoo is consistent with what Gmail (and more) which can include the recipients name using this markup:
?to="John Doe"<john#doe.com>".
Unfortunately, I can't find what markup Yahoo Mail requires, or if it can be done at all through Yahoo Mail.
Thanks in advance for the help.
Yahoo does not allow you to mark up the name of the recipient through the URL like Gmail and Outlook, you can only place email addresses in the to, cc, or bcc fields.
23-12-2021: Surprisingly now it works! I am making a laravel app and what I wanted was what the author of this question was asking about. So I gave it a try and it worked.
Sample html code:
{{ $supplier->email }}

Prevent email clients from auto-highlighting email addresses with HTML/CSS

I am looking for a CSS/HTML workaround to prevent email clients such as Outlook and Apple Mail from auto-highlighting an email address in my HTML emails.
My markup is:
<p>To ensure that our messages are sent straight to your inbox and not your junk or bulk email folders please add crmpicco#crmpicco.co.uk to your address book</p>
and Outlook (and Apple Mail) presents this as this:
I have tried wrapping the email address in an <a> and setting text-decoration: none, but Outlook seems to ignore this (I haven't tested that with Apple Mail)
Is there a workaround for this?
There is no universal fix for this since different email clients handle email addresses in plain text differently. Although you are on the right track with wrapping the address in your own html since the client will not do it.
To the best of my knowledge, Outlook does not remove styling on <a> tags, so this should work there as well.
address#example.com
I recommend getting an account at litmus.com where you will be able to use their email builder (it´s really an html editor in the browser) and get instant previews of 30+ email clients (3 after the trial period) while editing the email. The editor alone is worth a look.

How to send an html email in lotus notes 8.5

I have read about the problems with Lotus notes not rendering styles and some other things properly, but my problem hasn't gotten that far. My end goal is to send an email through the mule ESB and have the email render as html. In trying to get this to work, I simply want to send a simple markup in the body and have it render. Once i can figure this out, I can try to build on it to get everything else correct.
My simple email message I would like to send is
<html>
<head>
<title>TestingStuff</title>
</head>
<body>
Hello!
</body>
</html>
And I would like to receive the email which just says Hello! When I receive the email, it is exactly as typed, it does not get rendered as html. Do I need to do anything else to specify that this should be rendered as HTML opposed to plain text?
You can't just enter HTML into the Notes client and expect it to work. And even if you tell Lotus Notes that you're entering HTML, you can't expect the message it creates to be exactly like one that you're going to create in code. You can't really even expect it to be close.
If you want to send a test email message into a Notes user and retain complete control over the contents of the message, so that it will be processed exactly the way a message that you would from code will be, then I suggest that you learn how to use telnet to send a message to an SMTP server, and learn about the structure of MIME messages from a good general tutorial, or from a tutorial that deals specifically with email messages with text/html content.
In Notes 9 you can use "File" -> "Import" and then select your HTML file.
I don't know if that's possible in Notes 8.5 too.

How do I get HTML rendered in creating email message with velocity?

I use velocity to create a string writer, then merge that into a template. The template #includes html to make a simple table, yet only the raw HTML shows up in the email... it does not get rendered. Email is being sent from Google server to outlook client.
Can anyone tell me How can I get rendered HTML into an email message created with Velocity?
Thanks!
You have to set a Content-type: text/html header.
Appart from that, you have to be aware that all the different email clients may strip the HTML tags and features (for example, styles), so you have to experiment with different email clients and try to stick to a very basic feature set.