Skip to content

Instantly share code, notes, and snippets.

@artlung
Created August 28, 2016 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artlung/ed7701b27062305be51a488929d10bd9 to your computer and use it in GitHub Desktop.
Save artlung/ed7701b27062305be51a488929d10bd9 to your computer and use it in GitHub Desktop.
<%
Function obfuscateEmail(inEmail)
Dim strOut
strOut = ""
strOut = strOut & "<a href=""#"" onmouseover=""this.href='mail'+'to:"
strOut = strOut & Left(Server.UrlEncode(inEmail),3) & "'+'" & Mid(Server.UrlEncode(inEmail),4,1) & "'+'" & Mid(Server.UrlEncode(inEmail),5)
' jcrawfo'+'rd%40laur'+'elsprin'+'gs%2Ecom'
strOut = strOut & "'"">"
strOut = strOut & Replace(Replace(inEmail,"@"," [at] "),"."," dot ")
'jcrawford[at]laurelsprings dot com
strOut = strOut & "</a>"
obfuscateEmail = strOut
End Function
%>
<% Response.Write obfuscateEmail("jcrawford@laurelsprings.com") %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment