Outlook HTML - Signature editing without autospace - html

For a Windows server (16) environment I push different HTML e-mail signatures (Outlook) to all users.
The issue: After adding the signature, Outlook sets an unwanted autospace after each paragraph (enter). I want to change the HTML, so that hitting enter does not result in extra whitespace (so similar to shift+enter).
Signature example
The signature works as it is supposed to. I have sent an e-mail to myself to take a look at the HTML body created by Outlook. As is known from previous posts, this is entirely different from the HTML which I've added.
Looking at the HTML created by Outlook, after manually changing the autospace to 0, Outlook has created many paragraphes, all containing the following statement: style='text-autospace:none'
Since hitting enter results in new paragraphes which do not contain this style-tag, this does not resolve my issue. Using this same style tag in an overarching div, span or table does not solve my issue. I've tried working with paddings and margins, but this has no effect on the paragraph autospace.

Related

How to insert HTML (including images) in an e-mail in Outlook 2016+

Although Outlook sends e-mails as HTML by default, Microsoft seems to want to make it hard for us to write that HTML ourselves. One important reason for using HTML is to keep the size of an e-mail down when inserting an image by using an <img> tag to access the image from online instead of inserting the image itself in the body of the e-mail.
Several sources [e.g., 1, 2] say that the way to do this is to use "Insert as Text" to insert a file containing the HTML code. But as of Office 2016, the "Insert as Text" option is no longer available by default. Fortunately though, there are also sources [e.g., 3] that show how to get it back.
However, when I tried this, Outlook did not interpret my HTML. So, for example, if I make a file containing the line:
<img src="https://www.lenetek.com/blog/how-to-create-html-emails-in-outlook/images/attach_file.jpg" alt="Random online image">
and then use "Insert as Text" to insert that line in my e-mail, the result is just that line of code, not the image. What am I doing wrong?
(As indicated by the alt attribute, the image file in that example is just a random online image that appears in one of the articles referenced above. I have no affiliation with that website.)
The answer is very simple. In a way, it's obvious, but in another way, it's not.
The answer is that each segment of HTML code inserted has to be a complete HTML file, including the <!DOCTYPE>, <HTML> and <body> tags, not just the desired HTML code. The reason this is not obvious is because if you insert multiple code segments, each one has to be a complete HTML file, which is something you would never do when actually writing HTML. I presume that what is happening is that when Outlook detects a valid HTML file being "Inserted as Text", it strips the opening and closing <!DOCTYPE>, <HTML> and <body> tags and then inserts the code that was between them -- as HTML, not as text.
So, the solution I found was that instead of the single line of code shown in the question, I need to "Insert as Text" a file containing:
<!DOCTYPE html>
<html>
<body>
<img src="https://www.lenetek.com/blog/how-to-create-html-emails-in-outlook/images/attach_file.jpg" alt="Random online image">
</body>
</html>
When I insert that as text in my e-mail, I see the image, not the code.
In all the sources I found online that said to use "Insert as Text" to insert HTML in Outlook, none of them said it had to be a complete HTML file instead of just the desired code. So maybe this Q&A will be helpful to someone else, if I'm not the only person who had to scratch my head for a long time before thinking of that.
========================
Added details about using HTML in the e-mail:
As pointed out in the Lenetek article linked in the question, Outlook does not support all HTML tags. In particular, for embedding images, I have found:
When sending from Outlook:
Outlook does not support <figure> and <FigCaption>. I found that an image and caption placed in those tags were rendered inline, just ignoring the tags. For floating to the right margin, I found I was able to get the same results by replacing <figure> with <table> and then placing the image and its caption each inside of <TR><TD>...</TD></TR>.
When receiving in Outlook:
There are differences in how different e-mail clients interpret HTML, which is probably why some e-mails come with a link at the top for viewing the e-mail in one's browser. In particular, I've read that Outlook is not well behaved in this regard. And that was the case with my right-floated image referred to above.
After doing the "Insert as Text" trick, the image appeared correctly at the right margin in the draft e-mail in Outlook, but when it was sent, the CSS style float attribute was ignored and the table appeared by itself at the left margin with no text wrapped around it. I was able to fix this by, in the <table> tag, replacing the style attribute float: right; with the old-fashioned HTML attribute align="right". With that, the image and caption appeared correctly at the right margin when received in Outlook. I have not tested what it looks like in other e-mail clients.
In addition to NewSites answer, I want to point out, that in current Outlook 365 versions the option for "Insert as text" does not appear in the standard settings. The mentioned function under the "attach" tab does NOT offer the "Insert as text" option in the modal window.
For this to work, you will have to add a new tab yourself to the ribbon and add the "Attach" button to this new tab. Once you click this newly added button, you will get a modal with the little dropdown next to the "Insert" button.
I had this same issue and have been so frustrated. It's actually super easy. The trick is to use outlook.live.com. Type any word in the body, highlight it, right click, select "inspect". The code will appear and the word you typed in the body of the email should be highlighted. Right click in the code and select "edit as html." Then, in the code, highlight the word you typed in the body and replace it with your code. Voila! (I learned that here: https://youtu.be/yZOYRhB6ONs)
I had issues displaying the linked image while generating outlook email using HTML code. Somehow it works on a couple of machines, but most didn't show the image.
Kept on researching knowing the problem is with Outlook interpreting the HTML code. And then I reached this thread and the #NewSites answer really nailed it. Just added the line <!DOCTYPE HTML> at the top of my HTML code and all are working perfectly now.
Outlook 365 (2022 Update)
For Outlook 365, the Attach option needs to be enabled manually. Modify the Command Ribbon from inside the message, not the main Outlook window:
Note this option is Attach File without subcommands, i.e. the "classic" Attach File.
From there you can choose Insert as Text as the HTML snippet will show up as processed, not just code.
Outlook version for this post: Microsoft® Outlook® for Microsoft 365 MSO (Version 2202 Build 16.0.14931.20652) 64-bit

MS Outlook is removing hidden text in reply email

We have Ruby script that fetch and parse reply emails from our clients and putting them on appropriate client object in application.
For that purpose we send email to client with specific "hidden" code/id inside 1x1 pixel img tag (in similar way tracking pixel technology works) when clients reply to email, they quote our original email with code/id inside. And when we get client reply we can detect that hidden code from img tag, and process it accordingly. This works fine except when clients are replying from Outlook 2013.
Outlook 2013 removes image data containing code/id, and put something like "Image removed by sender." so we cannot detect see code/id anymore.
Also tried, making a image from base64 and even encoding code/id inside base64 image, but we got same result.
We tried different solutions, like making custom tags with class name contain code/id. Those custom tags are removed too, and replaced with something like < o:p >< /o:p >
We tried to put code/id inside invisible div, in inline css and various css tricks, and in this case Outlook just removes invisibility of div, and code/id is visible in email content.
There is a option that code/id is visible text inside body or subject, but we would like that this code/id be stays invisible to the clients.
It seems like its almost impossible to pass some hidden data trough reply email from MS Outlook.
Is there any way that we can pass this code/id trough reply email from outlook, without outlook removing it or making it visible?
Thank you.
Unless the data is visible (one way or another), chances are Outlook (or rather Word-light used for editing emails) will remove it.
White text on white background would probably work...
<img src=3D"https://t.yesware.com/t/58c8a29bcdf01103c9661815ef20eff8d=
f34a1b3/556ad713ae0cb0b15199a455f1fa5dfd/spacer.gif" style=3D"border:0; wid=
th:0; height:0; overflow:hidden;" width=3D"0" height=3D"0"><img src=3D"http=
://t.yesware.com/t/58c8a29bcdf01103c9661815ef20eff8df34a1b3/556ad713ae0cb0b=
15199a455f1fa5dfd/spacer.gif" style=3D"border:0; width:0; height:0; overflo=
w:hidden;" width=3D"0" height=3D"0">
I will address this dry-snitching code in a bit
Yesware is a paid service that allows you to track when and where the recipient of your email opens that email, every single time that they do or if they forward it to someone else, you will get the IP address and device type of each of those opens as well.
I've used Yesware for years, this is the first time that it has peeked it's little head out. In an email chain involving my Gmail hosted email and someone we will call Quarles. The first email I sent Quarles went normally, I received notification from Yesware that Quarles opened it from an iPhone. No further notifications came from YesWare which is impossible because he has replied twice.
I discovered in the latest email thread, under my second reply, Image removed by sender.Image removed by sender.
Below my third reply, Error! File name not specified.Error! Filename not specified.
I viewed the headers and, damn the luck, Quarles is using Outlook on a Mac Microsoft-MacOutlook/10.c.0.180410
What I am curious about is what Quarles sees on his end. Because the gif is not gone, the code is still there in our thread untouched. I know because if I open the email thread from another device (non-sending device) I get the notification that someone opened the email. So, what is preventing the code from calling home? Is it his MacOutlook? Is it an add-on he's got?
I am seriously considering having my husband write something better than Yesware. He's not a programmer but he is a SysAdmin so he'll figure it out. Besides, the stupid programs he has designed looked like crap anyway so why not write code for something that is supposed to remain unseen.
Oops, gotta go, if he catches me on stackoverflow he's gonna freak.. ;)

Remove the automatic link in HTML Emails [duplicate]

I'm sending an HTML mail from my app, this mail contains URLs, is there a way to prevents from mail clients to show these URLs as links?
for example:
<table>
<tbody>
<tr>
<td>http://www.google.com</td>
</tr>
</tbody>
</table>
will generate" http://www.google.com
instead I want it to generate a static text.
any thoughts?
This is a feature of some mail clients and there's no foolproof way to stop them from doing whatever they want with the message contents.
You could try to trick the mail clients by wrapping the addresses in empty tags and hope that they aren't smart enough to see through it:
<td><span>http</span><span>://</span>www.<span>google.</span>com</td>
Use a "zero width space" character: ​
It does as the name implies. It adds a space in your string but the space takes up zero width so instead of looking like two strings, it looks like one.
I have found the accepted answer doesn't work for Outlook 2013. I have had success with the following:
http<a href='#' style='text-decoration:none; color:#000;'>://www.google.</a>com
Setting the style cursor:default is not honored by Outlook 2013, but if you only make the middle of the url a hyperlink then a user can still select the link text without the cursor pointer appearing.
I'd say that largely depends on the mail client and thus is beyond your control. The only option would be to not make it a URL. E.g. write www.google.com (which the user can copy/paste just like the URL.
I didn't have any luck in preventing MacMail and Yahoo Mail from creating links out of any text string ending in .com (or other domain extension). After hours of testing (even 'href=""' and 'href="#"' did not work), I finally inserted my own URL and then manipulated the CSS and inline styles to remove the mail clients' link styling.
Adding in hidden line break elements in the right places seems to have fixed this for me (for now) in almost all clients, including desktop Outlook, according to Litmus's tests (Apple Mail desktop looks like the main exception).
https:<br style="display: none;"/>//www.w3<br style="display: none;"/>.org/TR/2020/WD-WCAG22-20200227/

mailto link doesn't add Outlook signature in letter

I (and some folks) need to send a lot of similar e-mail's everyday. Using Outlook 2010 as mail client. Today I want to somehow simplify this process.
Thinking about html page with mailto links. Like:
Letter to someone
Letter to someone else
etc...
Problem is come out when I clicked on one of them. Outlooks "New message" window pops up, but without signature. It's only text from mailto link in body.
Can someone point out what I did wrong?
I'm trying to figure this out as well.
According to http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_26410679.html you get either the body or the signature. I've tested this and removing my body text brought my signature back.
Alternatively, you can hardcode your signature into the body text.
Microsoft is not going to fix this bug. The workaround is to add it in the email body.
I believe the following MSDN article explains what you're describing: Messages that are created outside Outlook do not include the default Outlook email signature (KB 2544665)
Pretty sure you cannot customise a signature from the mailto: link.
The 2 ways to look at it is either setup your signatures in Outlook itself or, add the "signautre" to the bottom of the body included in the link?

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