homepage Welcome to WebmasterWorld Guest from 174.129.103.100
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

    
Encoded mailto text link gives me 404 error
No javascript
Kickedout




msg:4449055
 7:41 pm on May 3, 2012 (gmt 0)

I'm implementing a simple mailto link, but just econded the email to avoid spam (I don't want to use javascript). However is not working when I click it I get this on browser address bar


http://www.example.com/mailto:informes@ba
?Subject=Mysubject%20Bla

Seems like is not understanding is a mailto link.

What's the problem?

code I use on html body

!-- #BeginLibraryItem "/Library/languages-brasil.lbi" --><div id="bla1" class="link"><p id="current" href="#">
<a href="&amp;#109;&amp;#97;&amp;#105;&amp;#108;&amp;#116;&amp;#111;:
&amp;#105;&amp;#110;&amp;#102;&amp;#111;&amp;#114;&amp;#109;&amp;#101;&amp;#115;
&amp;#64;&amp;#98;&amp;#97;&amp;#114;&amp;#105;&amp;#108;&amp;#111;&amp;#99;
&amp;#104;&amp;#101;&amp;#46;&amp;#101;&amp;#115;&amp;#112;&amp;#46;&amp;#98;&amp;#114;?
Subject=Contato%20desde%20www.example.com">Contato</a>
<img src="images/contato.gif" alt="Contato" width="19" height="12" border="0" /> | 
<a href="/sancarlosdebariloche.htm" id="current" class="link">
English <img src="/images/english.gif" alt="English" width="19" height="12" border="0" />
</a>&nbsp;| <a href="/bariloche.htm" class="link">
Espa&ntilde;ol <img src="/images/argentina.gif" alt="Espaņol" width="19" height="12" border="0" />
</a> | <a href="/index.htm" class="link">
Portugu&ecirc;s <img src="/images/portuguse.gif" alt="Portugues" width="19" height="12" border="0" />
</a></p>
 </div><!-- #EndLibraryItem -->

[edited by: phranque at 7:39 am (utc) on May 4, 2012]
[edit reason] edited to fix sidescroll [/edit]

 

Staffa




msg:4449061
 7:59 pm on May 3, 2012 (gmt 0)

Try this one :

<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#105;&#110;&#102;&#111;&#114;&#109;&#101;&#115;&#64;
&#98;&#229;&#114;&#105;&#108;&#111;&#99;&#104;&#101;&#46;&#101;&#115;&#112;&#46;&#98;&#114;">Contato</a>

[edited by: phranque at 8:25 pm (utc) on May 3, 2012]
[edit reason] fixed sidescroll [/edit]

Kickedout




msg:4449070
 8:11 pm on May 3, 2012 (gmt 0)

Thank you. I did.

It doesn't work inside the library item (is exactly the same code, but without the subject thing)...

It does work outside the library item. The problem is that link has to be in my nav bar.

What's wrong with putting it inside the library? Any workaround?

londrum




msg:4449071
 8:18 pm on May 3, 2012 (gmt 0)

you've got it looking like a URL, with a domain name at the beginning. you don't need that for a mailto address.
it should look something like this

<a href="mailto:someone@example.com?subject=Title">blah</a>

so you need to encode this bit...
mailto:someone@example.com?subject=Title

... if its not working maybe you've got a base href set in the <head> ? it might be adding the domain name to the beginning because of that

[edited by: londrum at 8:28 pm (utc) on May 3, 2012]

Kickedout




msg:4449081
 8:28 pm on May 3, 2012 (gmt 0)

Why do you say that? My code is exactly a mailto link but just encoded..

londrum




msg:4449082
 8:31 pm on May 3, 2012 (gmt 0)

because you said when you click it, you get taken to http://www.example.com..blah blah in the address bar.
that doesnt happen with a mailto link

hover over the mailto link, and see what it says in the status bar

Kickedout




msg:4449086
 8:39 pm on May 3, 2012 (gmt 0)

Seems you have a point.
Hovering shows
http://www.example.com/&#109;&#97;&#105;&#108;&#116;&#111;:
&#105;&#110;&#102;&#111;&#114;&#109;&#101;&#115;&#64;&#98;&#97;&#114;&#105;&#108;&#111;
&#99;&#104;&#101;&#46;&#101;&#115;&#112;&#46;&#98;&#114;?Subject=Contato%20from%20www.example.

How do I get rid of the http://www.example.com part?

[edited by: phranque at 7:41 am (utc) on May 4, 2012]
[edit reason] edited to fix sidescroll [/edit]

phranque




msg:4449205
 7:43 am on May 4, 2012 (gmt 0)

you need to use an href attribute value which doesn't look like a relative url to the browser, which means you probably have to leave at least the url scheme (mailto:) unencoded.

Kickedout




msg:4449588
 7:26 pm on May 4, 2012 (gmt 0)

Thanks! But sadly didn't work. Doing such a thing results in mailto working opening email client but in TO field appears literally: "&#109;&#101;&#115;&#64;&#98;&#97;&#114;&#105;&#108;&#111;
&#99;&#104;&#101;&#46;&#101;&#115;&#112;&#46;&#98;&#114"

So no joy either.

londrum




msg:4449595
 7:36 pm on May 4, 2012 (gmt 0)

encoding it won't protect it from spambots anyway, it's an old-school trick, about a hundred years old.

if it's protection from spambots you're after, then it's probably no protection at all.

what's the problem with using javascript? at least you'll get a little bit of protection with that.

Kickedout




msg:4449613
 8:24 pm on May 4, 2012 (gmt 0)

old school or not worked fine to me for years, no complains. but doesn't into library items, what is a problem. (I'll have to move to jscript seems)

Kickedout




msg:4449661
 10:12 pm on May 4, 2012 (gmt 0)

I couldn't find a javascript allowing body variable in several lines.
Like:
"please tell us about you

name:
age:
and so on:
"

That's something actually I can do with my old school technique.

londrum




msg:4449850
 3:33 pm on May 5, 2012 (gmt 0)

you dont need to javascript the whole thing, just the email address. the rest of the mailto link (including the subject and body variables) can be written like normal.

if you google "javascript email obfuscation" you'll get loads of ways to hide it

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved