I am trying to add some images to the email body that gets sent to the users email (not as attachments) but when they arrive via the email they are broken and do not show.
I have tried using:
<img src="https://example.com/wp-content/uploads/2019/11/myimage.jpeg">
<img src="wp-content/uploads/2019/11/myimage.jpeg">
<img src="uploads/2019/11/myimage.jpeg">
But nothing works, I thought it would be as easy as adding an image as you do via html but it doesnt seems to work. Does anyone know how to do this?
Are you sending the email as an HTML doc or are you just putting HTML text into the email doc?
Your email service might be reading your code incorrectly, thinking it's just text being sent in an email document.
Do some troubleshooting. Can other HTML elements (like headings and hyperlinks) appear in your email? If not, it's an email problem and not one with your code.
That being said, the 2nd and 3rd links are not viewable via a browser - it looks like they are pulling from your system as opposed to being an online link. That might be part of the problem as well.
Related
I am sending HTML content in email. Inside the HTML I have some thing like
<img src="https://example.com/logo.png" border="0" alt="Logo" class="styleclass">
when I open in gmail and yahoo, it is showing correct image.
I replaced the image in server with same name and I am sending emails again.
In yahoo it is showing new image, but in gmail it is showing old image.
I searched about it and I came to know, google stores images in proxy server when we open first time, and from the next time it will show the image from its proxy server. If I change image name in link, it may show correct image. But I can not change my link. I'd like to know if anyone ever came across this and if so, how it was solved.
In gmail, my code is modified as below.
<img src="https://ci6.googleusercontent.com/proxy/4sG5UHo-nA6ZlKKtDIWy8f9hKIVM9bM9uBFsS_0HI8yEuKaCfxH695uj5VpUAEUahDmSTEOyJVu76V5Zdz2bi28=s0-d-e1-ft#https://example.com/logo.png" border="0" alt="Logo" class="styleclass">
Try to change image name and reupload it. Google proxies has catche which saves image, so when anything change with domain it can lead to incorrect url.
I checked this post and it helped me today:
Gmail's new image caching is breaking image links in newsletter
I come with an issue that is giving me some headaches.
I'm sendind some e-mail confirmations, using JavaMail and an HTML template, that is written on the message content.
This HTML template, has a URL on it, but this URL is not wrapped into a tag, it's just a plain text inside the HTML body.
The problem is that the URL appears as a clickable link on the mail message, and that's not the behavior I'd like. I'd prefer the user to copy and paste the URL to the browser (security policies at work)
Have any of you done something like this ?
Thanks in advance
You can't. You cannot control how mail user-agents handle incoming mail. Mail clients do this for the convenience of the user. I fail to see how this is a security issue.
The only alternative is to put the URI in an attached image, but that would just annoy your users.
you could explicitly code the url to not be a clickable link (a without the href)... It will still appear as a link, but it won't be clickable.
EDIT: It seems the user below is correct.
EDIT2: It actually seems I may have been correct. I tried composing an email at
http://putsmail.com/tests/838716156f824732c7f5456122c38e
with the html:
<html>
www.google.com
<a>http://www.google.com</a>
</html>
and the second link appeared as text.
You can't explicitly insert html in the gmail client, but you can with your own.
EDIT:
I went back this morning and tried this html:
<html>
www.google.com
<a>http://www.google.com</a>
http://www.google.com
</html>
and only the second link was plaintext. Just FYI...
I've found a way to do this.
The key is to insert a zero width space () somewhere between the URL
So, I changed my URL from
http://my.site.com/somecontext?contextid=somekeyvalue
to
http://my.site.com/somecontext?contextid=somekeyvalue
And now the URL is not interpreted as a link by the mail clients, but it's still good for a copy-paste to the browser.
Thank you all for your help!
Does anybody know how to send embed code in a HTML email without the code being rendered.
I want to email the user a code that they can put on their website that shows that they are in the top 50 list on my site.
Here is an example of the code I'm trying to send:
<div style="display:inline-block;"></div>
I tried sending it in a textarea, but hotmail replaced the image src with their image proxy URL.
So I need this code to stay the same.
Any ideas?
thanks.
In our WCF app, there is a method to send an html formatted email. I am using StringBuilder to build the html.
I am including an image in the email. When the app sends the email, the email is formatted correctly. However, the image doesn't display unless the user right clicks and selects "Download the Image".
Is there a way to have the image automatically display in the html email without the user having to select download image?
Here is my image tag:
<img src='http://www.MySite.com/Images/Mylogo.png' border='0' />
This is intentional behavior of the email client, there's no way to guarantee that the image will automatically show for all clients. You're going to have to live with that. In fact, some people prefer to read email in plain text.
If the image is relatively small, you might consider attaching it to the email instead. You'd have a better chance of having it displayed by default, though there are obviously other costs.
I have created an email template, I use PHP to send the email, but the problem is that images that I have included inside the email template are not being displayed properly. It's showing the cross symbol. In Outlook, they mention "click here to download the image" - but nothing happens when I click.
What is the solution for this? How can I send the email along with the image?
You are best off not sending images in the email itself, but rather linking to them on the web. So, in your email, you have:
<img src="http://www.example.org/picture.jpg" alt="My Picture">