I'm trying to send email by using Symfony and I found that I can't use position and background: url() because Gmail stripped them. So I want to know how many CSS attributes which Gmail stripped?
Gmail basically removes <head> tag and all "linking", like you mentioned background URL. This is vunerability because you can pass any data by encoding image (base64 encoding).
I belive Google never published details on this, but we can only presume.
I would suggest you bullet-proof test your mail here
Related
I am trying to generate email signatures for my entire company so I am using a script to fill in an HTML template with each individual's information and generating an HTML file that I would like to use for the signature. The generation of the HTML works fine and I can load the HTML into chrome and it displays 100% correctly.
I would prefer to not have to host these images somewhere at the moment and would like them to be embedded in the e-mail. We can achieve this by using outlook on each individuals machine to create the signature by hand, but again we want to avoid that. Ideally, we will generate these templates and then automatically put these files on each employee's computer so all we have to do is select the signature from outlook.
The problem we are having is that when we do this, the image does not load. It seems that outlook won't allow base64 encoded images? I've tried to work around this by trying to attach the image to the email and then referencing it, but this doesn't seem to work either. I used this template. I got the boundary from a test email I sent myself, but I don't even know if this is a good way to go about this either.
In short, is there a way to create an .htm file for outlook signatures that includes the image inside the .htm file?
External image file that will be added as an attachment is the only way - Word (which renders HTML messages in Outlook) does not support base64 embedded images.
Try to create a new signature with an image in Outlook and see how they reference the images.
I send the same email to gmail (the image is loaded correctly) and outlook (Failed to load the given URL).
In gmail i have this html code:
http://xxx/~mgxzbmdx/joomla/images/stories/virtuemart/vendor/logo.png
In Outlook this one:
https://dub113.mail.live.com/Handlers/ImageProxy.mvc?bicild=&canary=nUc%2fUMnrf0l9V5rzT3XB4Cb5axSzPUBWqwI5uP2ZjrU%3d0&url=http%3a%2f%2fx.x.x.x%2f%7emgxzbmdx%2fjoomla%2fimages%2fstories%2fvirtuemart%2fvendor%2flogo.png
Any idea about the reason?
The problem is the file type.
HTML emails should only use .gif or .jpg.
Try with a new picture format. I suppose you use a .png file because it has transparency? It saddens me that I have to tell you this, but you'll be better off faking transparency with split images in nested tables. That's the only way for a html-email not to break.
I think the issue lies with your method/software. Looks like your / are getting converted to %2f which gmail seems to be smart enough to interpret, but Outlook is not. See if there is something in Virtuemart or Joomla that you can turn off link encoding or something like that.
We have a content-managed solution (SDL Tridion, to be specific; however, the question is more general), which includes multiple sites with content of different languages. They all share a number of Razor-based templates, which are used to render HTML fragments with specific injected content when pages are published.
CRM is also managed through the CMS and the same templating is used for the creation of email newsletters. These HTML emails contain images, which are published out to whatever site manages the distribution list in question. Because the templating system is generic and the CMS has no concept of the absolute URLs of the final product, these images are all embedded with relative addresses. We have the capacity to apply an absolute URL as metadata to the different websites in the CMS and write .Net extensions to format these URLs into rendered image tags; however, this would add considerable overhead to this piece of work.
We can resolve this by using a <base href="..." /> tag in the <head> section of the email's markup. This seems to work in Outlook, at least; however, I have not been able to find much up-to-date information on what email clients do and do not support this tag.
The question, then: How widely supported among email clients - particularly browser-based ones - is the <base> tag?
Unfortunately, it won't work for most web-based email clients (Hotmail, Gmail) and that typically adds up to about 30% of receivers.
Why it won't work:
Most web-based clients inject whatever's inside the body tag of your email and strip out everything else, including the head. So, if you send:
<html>
<head><base ...></head>
<body><p class="youremail">Email</p></body>
</html>
The email client does this:
<html>
<head><Email client head></head>
<body>
<email client wrapper>
<email>
<p class="youremail">Email</p>
</email>
<email client wrapper>...
</body>
So your base tag will be stripped. Even if it wasn't, since it's not include in the email client's head, it will be ignored by the browser.
Unfortunately, absolute paths on images is the way to go. I have got over similar problems in the past by using a 'preflight processor'. You could use that to get the <base> href and set it on all the images before returning the finished HTML.
I couldn't tell if your using Razor or not, but if you are, you can do this inside a razor view:
src="#Request.Url.GetLeftPart(UriPartial.Authority)~/images/screenshot.png"
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".
I have an email sent out in in my application, and in the HTML of that email, i have an <img> tag which is an image and a link.
The problem is that in most cases the image doesn't load in emails, unless you enable the viewing of embedded images.
That image is an important part of the email. Is there any way I can replace the image tag with something else which always loads in emails? The desire is that users don't have to explicitly click on show pictures to see it.
Absolutely... you can embed the image as an attachment, and then use the CID header in the mail MIME to reference it (instead of a URL to a web resource)
There is no way to guarantee that an image will be displayed without explicit permission of the user. That would circumvent the whole concept if it were possible. The idea is to protect the user from exposure to undesirable content. In the event you were to find some hack way around it, it would be considered just that, and could get you blacklisted once the hack is discovered.
Is the img tag just a reference to an external image that's hosted somewhere? You could try adding it to the email as an embedded resource and see if that helps. Some mail clients may still ask permission before displaying it, though. But it should get more of the target audience.