Specifying the subject line in an HTML email - html

I'm coding a quick HTML email using Foundation for Emails.
The tech stack isn't of huge importance, just highlights what I'm trying to accomplish in general.
Something I'm wondering about is when someone receives my email (through any of a huge number of possible email clients) is it possible for me to specify in my HTML template what the "Subject" line should read?
In case I'm not being clear enough, I'm referring to the teaser text you see in your inbox before opening the actual email:
Like in this instance from Gmail below: the "Your Amazon.com order of "Shovel Knight Amiibo"... text.
Is it possible to specify that text in my HTML template? Or is that handled by a service request?

The mail subject is a header, e.g:
From: John Smith <john.smith#example.com>
Subject: Good news!
It isn't taken from the message body so the answer is no.
You need to specify it with whatever program/code you use to actually deliver the message and it has to be plain text.

Related

HTML table in reply mail

We require the users to reply in a specific format about their problems. Our current application sends an auto-generated mail which has a mailto embedded like this
Contact Application Team
What we want now is to include a table in the embedded "mailto" so that user can describe their problems in much better way. We have tried encoding html inside mailto body, but it gets treated as simple text.
Is there any way to include the table in the mailto body or any better way to improve the interaction.
It is not possible to include HTML in the mailto body, as defined in Section 2 of RFC 2368.
Possible alternate solutions:
Have users type their information into an HTML form and then use PHP (or similar server side language) to send the email
Try to format your email a little bit nicer by adding in some line breaks. You can use %0D (Carriage Return) followed by %0A (Line Feed). Maybe something like this:
Contact Application Team

Capture subject line from Outlook email into mailto link in signature

I am helping someone working in operations to set up an email signature which includes a link to escalate to a higher official in case of any displeasure. While I can use a mailto: to link to the official's email id, I want to also capture the subject of the email to capture details like Service Ticket number and any other title that is in the email subject.
What I mean to say in a nutshell is - when a user clicks on the link, he would get a new Outlook compose mail window with the same subject. Using simple mailto: with manually changing subject line wont help. Looking for some tips here - am open to look at dynamic options like VB code or something but it has to be via Outlook.
Include a placeholder in the signature's link (e.q. mailto:somebody#domain.demo?subject=xyzq), when Application.ItemSend event fires, look at the MailItem.HTMLBody property and replace the placeholder (xyzq above) with the value of the MailItem.Subject property. You might need to encode spaces and special characters.
The mailto: command doesn't allows to specify any custom information for Outlook. Read more about the mailto scheme in RFC2368.
If you are new to VBA, I'd recommend starting from the Getting Started with VBA in Outlook 2010 article which explains the basics.

What is the most successful/appropriate way to hide a string in an HTML e-mail?

I need to hide a 30 character string inside the HTML of an e-mail so when a user replies, their reply can be linked on our server to that 30 character string. We don't want to add the string to the subject or body of the e-mail where it's visible to the user. We also don't want to hide the text which would result in accidental selecting of the 30 character string.
The problem:
Many e-mail clients (like gmail) reduce HTML e-mail content to just the basic tags, making it difficult to find a tag that can hold an arbitrary string. This means we can't create an arbitrary tag, only use standard tags.
Our best solution:
Hide the string in the "title" tag of a table in the e-mail, like this -
<table title="30_character_string">
The solution above works in most cases. Most e-mail clients don't strip out the title tag, making it a viable option.
Why we're stuck: This isn't the best solution because sometimes e-mail clients get very restrictive and eliminate even the title attribute.
Can you help? What is the most successful way to hide an arbitrary string in the body of an HTML e-mail? Is there a better solution for this sort of linking?
If you put the value in markup, plain text replies won't work. Consider a "smallprint" section on the bottom of your email below your signature.
Dear User,
Email content
Regards,
Logo and such
ReplyIdentifer-xxxxxxxx.
If you don't care for that, add a div to the bottom of the email (again below the sig). ANd again, it will be on the bottom of the email where the user will rarely even care to look.
<style>.hide{display:none;}</style>
<div style="display:none" class="hide">ReplyIdentifer-xxxxxxxx.</div>
In this case, you only see it if the email client removes css AND style tags.
Checking some HTML emails I've received & Gmail seems to allow a <head> tag within the e-mail HTML. You could include the info in a <meta> tag within the head of the email.
What type of account are you reading mail in to? If it's also Gmail, you could make use of their ability to allow abritary strings in your emails address after a plus symbol. Override the reply-to header that you set on your out-going mail to youraddress+uniqueID#gmail.com
EDIT: Staying along the lines of e-mail headers though (which feels like it should be the right way to do this), if you make sure to generate a unique Message ID header for each copy of the mail going out, the In-Reply-To header that you get back should be unique to that recipient and that message. Gmail respects the Message ID header & provides the appropriate reply header in response, as should most (all?) mainstream clients/services

html newsletter email arriving as an attachment

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.

How to send mail with a Subject using a Mailto URL?

I need to make a Mailto link to my website which is suppose to contain either the product name or the product page URL in the subject section. How can I do it?
Exp: When you get an email through eBay about a product you are selling or buying, you automatically know what product that email is about by seeing the product name in the subject section.
How can i do this?
Email Me!
Internet Archive:
Set up an HTML mailto form without a back-end script
HTML Mailto Attribute and Tips
HTML Mailto Tips and Tricks
Mailto Syntax
Related Stackoverflow Questions:
Avoiding the Mailto Annoyance?
Best way to obfuscate an e-mail address on a website?
Effective method to hide email from spam bots
What are some ways to protect emails on websites from spambots?
I've run into problems with this before when I didn't url encode the value, so I would suggest (using lc's example):
<a href="mailto:foo#bar.com?subject=This+Is+My+Product">
or
<a href="mailto:foo#bar.com?subject=This%20Is%20My%20Product">
This page [Link Dead] outlines the syntax of mailto URIs:
Address message to multiple recipients
, (comma separating e-mail addresses)
Add entry in the "Subject" field
subject=Subject Field Text
Add entry in the "Copy To" or "CC" field
cc=id#internet.node
Add entry in the "Blind Copy To" or "BCC" field
bcc=id#internet.node
Add entry in the "Body" field
body=Your message here
Within the body use "%0A" for a new line,
use "%0A%0A" for a new line preceded by a blank line (paragraph),
What you are looking for is:
<a href="mailto:foo#bar.com?subject=This Is My Product">
Note, it's probably a good idea to URL encode the spaces with either a + or a %20:
<a href="mailto:foo#bar.com?subject=This+Is+My+Product">
Try This
If you want something more advanced, you're going to have to code it from scratch (or use someone else's script). Try looking into PHP, ASP.NET, Ruby on Rails, etc.
Try this code to set subject, body, cc, bcc
<p>HI venky!</p>