HTML Inside of Link - html

I'm sending out an HTML email. I'd like the recipient to be able to click the link from their email inbox and then have the HTML nested inside the link to be opened and rendered in their browser.
EMAIL:
<html>
<body>
<a href= **<html><body> You're now viewing this in browser </body></html>**> Click here to render HTML in browser. </a>
</body>
</html>
This is for a work email to colleagues, hence the reason I don't have a webpage to direct them to. Thanks!

It might be possible to do something like this with a data: url, in the format:
data:text/html,%3Ch1%3EHello%2C%20World!%3C%2Fh1%3E
Although I don't know if email clients will allow data: urls in links. My guess would be 'no' because it's probably a security problem.
Since you're looking to render something in a browser after clicking the link in the email, have you considered making a minimal website on a http:// url?

Related

Is it possible to link to a div without changing the URL (in HTML)?

So, basically, I want people to be able to navigate my website, through links to Divs, but PREVENT the browser from changing the current URL (it adds #divname at the end of the .html file).
I have something like this:
<div id="modalLogin" class="modalLogin">
<!-- random stuff here -->
</div>
And somewhere else I have a link to that Div:
<a href="#modalLogin">
<img class="btnLogin" src="../images/btnLogin.png" alt="Log in!"/>
</a>
But, as I mentioned before, whenever they click those kind of links, the URL changes. I'd like to be able to navigate the website WITHOUT that happening. If at all possible, using just HTML (no JavaScript, no jQuery, no AJAX).
While we're at it, I've seen entire websites not changing their URL at all (even when I've traced the requests and am clearly navigating through different files), and some don't even show you the 'expected address' (the URL on the bottom left of the browser). How do I do that?
Thanks in advance!
P.S.: I've searched this website, and apparently all 'similar' questions ask just about the opposite: how TO change the URL.
I think You Can Use Javascript for This.
//Grab your current Url
var url = window.location.toString();
//Remove anchor from url using the split
url = url.split("#")[0];
SAMPLE JSFIDDLE

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!

title="" not displaying in html email

<img alt="Check out our NEW E-Catalogue" title="Check out our NEW E-Catalogue" src="http:/image" border="0px">
The code above is what I'm using in a HTML email, sent via a email marketing platform.
When hovering over this image in Outlook 2010, and other email clients, the link shows instead of the title text.
Any suggestions?
That's typical behavior to avoid concealing intended link targets. A snippet from the referenced link:
If you code an image that also links to a web page, some email apps (Outlook2000 and Apple Mail) override both the ALT and TITLE, and show the URL of the link instead. They do this for security, so you see where the link takes you before you click.
FWIW, [as an end-user] I'd rather see where a link is going than what the author felt was more appropriate than the link itself. Case in point:
<a href="http://facebouk.com/login.php" title="http://facebook.com/login.php">
Login to facebook
</a>

HTML Email jump links not working

I've written a HTML Email using tables (:sad face:) and it displays perfectly while using Internet Explorer's Send -> Page by Email. My issue is that my jump links
Go to the jump link
no longer work, thye just open the complete URL of the page that I was sending. I've looked through the source of emails in which the jump links do work and I saw that the jumps links looked like this
Word generated jump link
I tried adding this but I'm still getting IE opening and it's now going to http:///
Any idea if there's any extra tags I need to add or another way to get around this?
Essentially, this is something that has to do with the way Microsoft deals with Internet Security. It is best practice to avoid named (jump) anchors in HTML email, unfortunately. However, to overcome this you might want to provide a link to a webpage with the HTML email on, which can of course have named anchors.
You can read more about best practices for email design on this article at Sitepoint. There is also a great resource for HTML email design at the Email Standards Project.
You can try this!!
In outlook -> new email->attach file->insert(select the html file here)->insert as text(dropdown on the insert)
Which will make the jump links work.
but the problem is all with the active links and visited link color. Doing this leave you no control over visited and active link colors.
You could create the email template as signature.
Open the tempalte in IE and click CTRL+A to copy the page.
Create a signature and Page the content as it is.
Create a New email and insert the Signature. The template will be loaded.
I had the same problem. When trying to send a html page using Internet Explorer's Send -> Page by Email, the anchor pointed to the url of the webpage instead of to the internal link in the mail.
This can be solved by adding this in the head of the page:
<base href="" />

Link to Homepage is forwardslash

Im have the default routing and write a link to the Homepage in my view
Link
The generated content is a forward slash.
Link
This link works in Firefox but in IE8 no request is sent to the server when the link is clicked.
Is a forward slash a valid content in a link?
EDIT:
OMG, I tried to have an image inside the link but actually put an input type image there. The funny think is that it worked in Firefox.
Thats how my linked looked like:
<input type="image" src="/Images/buttons/btn_buy_more.gif" alt="" />
I will leave this question here so you have somebody to laugh about.
Url.Action isn't supposed to send a request to the server. It just generates a link address. Look at the generated URI in the HTML source of the rendered page. I'll bet it's the same in both browsers.
What I think you mean is that clicking the link is behaving differently for you. To figure out why, use Fiddler to examine the request the browser sends and the server's response.