How can I Insert html embed code in email - html

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.

Related

Contact form 7 adding an image to the email body

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.

HTML Attachments opened in Apple device not showing some images

I am wondering if someone can help me with a problem I am encountering with iPhone/iPad. I have an email the generates a report as an HTML attachment. In that HTML attachment, there are two images. One is a static image that pulls down a logo using a normal HTML img tag.
The other is dynamic. It also uses the normal HTML img tag, however it calls out to a web api with some information identifying the user.
<img src="http://MyApiServerName.com/api/User/{id}/{OtherParm}" >
The Web API uses information on the user to return appropriate images to them. For some reason the dynamic image does not show up with the attachment is opened on an iPad/iPhone.
The image works just fine when the attachment is opened from a computer. I thought maybe something might be blocking images, however then I would expect the static image not to display as well. I verified that the "Load Remote Images" setting is turned on.
I am at a loss here. Is there something with iOS that prevents dynamically generated images from showing in HTML attachments?
Thanks
Ok, I can't explain why the above is not working, but I did find something that does. Instead of using the following URL
<img src="http://MyApiServerName.com/api/User/{id}/{OtherParm}" >
use
<img src="http://MyApiServerName.com/api/User/{id}/{OtherParm.jpg}/" >
The final param needs to end with ".jpg/". If the slash is not there, you will get a 404 error.
Then in the API method, you simply strip off the .jpg part of "OtherParm" to get the intended value for "OtherParm".

Javamail: Send a HTML mail with an "unclickable" URL on it

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
ht​tp://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!

monotouch: Image not displaying in email

I have some html that has an image in a table. The table displays fine in a UIWebView. I take that same html and send it in an email (using MFMailComposeViewController). The code snippet to build the html is:
html += "<tr><td><img src=\"reading.png\" align=left></td><td>"
The table is created properly, but the image just has a question mark in a blue box. (Obviously, it can't find the image, but why?)
How do I fix this?
The path "reading.png" is not found, that is the reason why you do not see the image.
There are in fact several potential solutions.
1) put the image to the web URL something like http://yourweb address.com/reading.png, this works well and will show, all the clients supports this and user just need to click to "show images" if he/she has it disabled by default in the email client.
2) second solution is to put the specific image representation to the img tag, you can do so by opening the file, reading its content and adding it as base64 data to the src of the img, there are plenty of samples for this.
3) third is to add it as attachment to the email. Again plenty of samples here and on the web how to do that.
Conversion of the sample code from ObjectiveC is simple to Monotouch.
Hope this helps.

Images not properly sent in email

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">