How to embed non hosted images into an email signature HTML - html

I need to embed images into an email signature, the images arent hosted on a website but I can't just reference images from a folder as this needs to work for 50 people. I've tried using URI for base 64 but gmail and a few other email clients won't open the images. I've heard about inline attatching them but don't know how to go about it.

I recommend using Google's embedded images as follows: You save your images to your google photos. Go to one of your images, then, click "share". Click on "create link". Copy that link and paste it in the text field on this site (Google
's embedded image site) : https://www.labnol.org/embed/google/photos/ Click "generate", and the embedded link for your image will appear. This is what I use for my HTML-Emails. Unfortunately, it is tedious if you have many images, but it works.

Related

Where can I host an image for use in my web page?

I am making a HTML email. I want my png image to be formatted in a hyper link like:
<img src="https://www.w3schools.com/images/w3schools_green.jpg">
Where can I upload my png image to get a link like above that ends in .png?
I know I can upload my png to files and grab it in files using HTML but I want everything to just be in one file.
Imgur is free and reliable. Alternatively, just put the image next to your html file and then set the url to just the name of the image
<img src="w3schools_green.jpg">
Have you tried using google drive? You can upload your images there and then use its link in the HTML. Here is an explanation of how to do it How do I display images from Google Drive on a website?
There are so many image hosting services available, just google "free image hosting" and you will get tons of websites. For PNG specific image hosting you can try: https://www.pngtank.com/en/user-request-png
However, choose your image hosting service wisely because if any of the website deletes your image, it will stop appearing on your website. You can also try storing images locally if this is an option for you.

whats the best route to add graphic assets to a google web app script? [duplicate]

I have a webpage that has an image that is stored in google drive, and using the google drive embed code results in this-
and I want to include this image in my website without the border and tools, making it look like this-
Adding the image file to my project is not an option, as I am using google apps script as web domain as I am not old enough to have a credit card to purchase REAL web domain, and I am broke and cannot simply rake leaves or shovel driveways because of COVID. so I cannot add the image file to my project, any advice?
Answer:
Instead of the embed code, use the view link.
Example:
<img src="https://drive.google.com/uc?export=view&id=FILE_ID_HERE">
This solution is a little bit ironic. The tool that stack overflow uses for images can be used for anything else, so I just had to right-click on the image in this question, click on 'copy image URL' then put it in my website and I got a working image!

Embed image from google drive without grey border and zooming tools?

I have a webpage that has an image that is stored in google drive, and using the google drive embed code results in this-
and I want to include this image in my website without the border and tools, making it look like this-
Adding the image file to my project is not an option, as I am using google apps script as web domain as I am not old enough to have a credit card to purchase REAL web domain, and I am broke and cannot simply rake leaves or shovel driveways because of COVID. so I cannot add the image file to my project, any advice?
Answer:
Instead of the embed code, use the view link.
Example:
<img src="https://drive.google.com/uc?export=view&id=FILE_ID_HERE">
This solution is a little bit ironic. The tool that stack overflow uses for images can be used for anything else, so I just had to right-click on the image in this question, click on 'copy image URL' then put it in my website and I got a working image!

How to embed image in HTML email template?

I have created an Email template using HTML and inline style from scratch. Now I need to add some images, at this point it's not possible to use url because it is not hosted. I tried using base64 encoding, it worked in Apple mail client, but the images are not rendering in Gmail. Is there any way to embed image in html supported by all email clients?
Host the Image publicly in Google Drive by sharing the link 'public on the Web' or 'anyone with the link'. Then use this link http://drive.google.com/uc?export=view&id=FILE_ID to get direct access to the image. You should replace the FILE_ID with actual id from Google Drive link.
Example :
Google Drive Link : https://drive.google.com/file/d/17iWczcf1T_D4kGRaQYBh6J2XOQI181u6/view?usp=sharing
Generated Link : http://drive.google.com/uc?export=view&id=17iWczcf1T_D4kGRaQYBh6J2XOQI181u6
Now you can use this link in your template.
Base64 has very limited support. Generally speaking it is not advised to use it. You can find information about base64 encoding support in this tutorial. It may help to decide if the supported client list is enough or not in your case.
Embedding images in the email is possible by sending them along with the email and reference the sent images with the img tag. A good starter reading for this method is Campaignmonitor’s “Embedding images revisited“ blog post.
The best solution is to host the images with a service provider, which is fast and maintained.
If you use Github, you can also serve images (or any other content) from the GH-Pages branch of a repository.

Google Drive images in img src=webContentLink?

Can I use images stored in Google Drive to be used in a website by the html,<img src="<webContentLink>" /> ?
Where <webContentLink> is returned after a file is uploaded and is in the format, 'https://drive.google.com/uc?id=<FILEID>&export=download'
I have a small website created for account users only. They can upload files to their google drive folder and this folder has permissions set to share with the accounts of the other users (specific people only). This is an ASP.NET MVC 5 website using the Google API Client Libraries for .NET.
In Chrome and Firefox the images display fine, in IE and Safari they don't show and return a 302 status code. Sometimes if you view the image directly in a new tab and then refresh the web page it shows. It might also show if the folder permission is set to 'anyone with the link', but this isn't ideal.
The documentation (https://developers.google.com/drive/v3/web/manage-downloads) says, 'If you want to allow a user to view a file directly in a web browser instead of through the API, use the webContentLink.' I understood this to be okay to use img src='' to display an image directly without the API, however it then goes on to say, 'You can either redirect a user to this URL, or offer it as a clickable link'.
So can Google please confirm if 'webContentLink' can be used in img src='', or not and why it works in some browsers and not others? I've read many posts on this, some old, some more recent. If it's not to be used in img src I think it should be made clear in the documentation.
Many thanks
Yes, you can definitely use webContentLink as your img src in your HTML page. I tried and this is what I got on my sample HTML page.
<img src = "https://drive.google.com/uc?id=0Bzgk4zncCwI7aDZCSHY4YU0zNUF&export=download">
webContentLink can be obtained using Files.list and place 'files' in the fields parameter.
Displaying an image from Google Drive can be done in 3 steps:
Retrieving your image ID
Right click on your image and select Share.
You'll see a link that you need to copy. You will extract the image's ID from the URL.
Here is what your sharing link should look like:
https://drive.google.com/open?id=YourFileId
Check your sharing settings
Your images will only be visible to people who have access to those files. To allow anyone access to your images, you need to set the sharing setting as Visible with the link.
Display your image
With your sharing settings properly configured and your image file IDs at hand, you can now specify how your images will be displayed using a prescribed format.
https://drive.google.com/thumbnail?id=YourFileID
More details can be found here
when I do this I just get a sign like an nonexistent image.
Why?
I just copy paste this line:
<img src = "https://drive.google.com/uc?id=0Bzgk4zncCwI7aDZCSHY4YU0zNUF&export=download">
JS Fiddle