Email address encoding & obfuscation

I realize many of you use contact forms to control spam. I never have. I can manage SPAM just fine with encoded email addresses on my site. The web design app I continue to use to maintain my non-responsive websites (not Blocs) automatically encodes all email addresses on export, yet leaves them in plain text when designing. When you view the web page, you see the email in plain text, but if you view the web page code, the email address is fully encoded. Here’s an example contact page in my site with encoded email addresses:

Click on the email and now how your email client opens and “sα” appears in the email address field, which is correct. Then go back to Safari and view the page code and search for “mailto” and you will find the email address fully encoded. Great! That’s precisely what I want in Blocs. But so far I cannot get it to work.

I’ve added “sα” to my page in Blocs, and then I made it a link, and I select “Nagivation to URL” in the Interactions section of the right sidebar, and then in the field I paste in the following encoded information:

I then export, preview in Safari, and then click my email address link. That opens a new email, but the problem is that the email address in Outlook ends up looking like this:

&#115 &#97 &#108 ...

With each set of “&” text being its own email address! In other words, it doesn’t work.

How do I encode my email addresses in Blocs?

I really wouldn’t have added your email address on the page here if you wanted to avoid spam. In the past I used obfuscation, but that was 20 years ago and I gather it is easily broken nowadays. I think you would need to add some sort of javascript on the page. If using a form the visitor doesn’t know your email address and neither does the spammer, unless you reply to them.

The strange thing is that I have used no anti-spam measures at all for the last 5 years and receive zero spam through the websites. My main sites are all on Cloudflare, so I wonder if these robot spammers are being blocked before they reach the contact page. Perhaps nobody visits my websites!

I substituted the greek alpha character for “a” in my email address, so it’s ok. :slight_smile:

I’m not concerned with JS solutions because like I said, I’ve been using the standard Freeway email address encoding for YEARS and it works fine. Server side SPAM filtering works well. For that reason, I am curious how to accomplish the same in blocks (without JS). It’s odd that pasting in an encoded “mailto” doesn’t work. Hmmm…

For Others that may read this later on:
‘Warning Will Robinson!’ - Do not do this unless you want to eventually get on a spam list. Encoding can be read by spam bots - this is why I always use a php script to actually send out email, that way the bots can’t get hold of it - Getting down off of my soapbox now :wink:

1 Like

No need to worry since nobody can do it now. Indeed, that’s precisely why I created my opening post, so I could hear replies on HOW to accomplish it. Thus far I’ve only received feedback on alternative solutions.

Regardless of my reasons for wanting it, and regardless of those who contend it isn’t a good idea, can someone please help me find a way to make it work? Again, I must refer everyone to my opening post. I simply don’t understand why it isn’t working. Do you?


I’m sorry for not be very present here, but I’m working on the Help Site “Code Bloc” and take me a log time. About what I see I think that you can’t use the mailto: option, the code that you provide have to be in html code brick , but the problem is, as soon you paste the code in html code, the bric itself, decodes the link and appears the email visible. (I think you use the code from this website, right?
So for that work, you have to paste the code manually in the exported website.

One of the things that works is the result from this website.
This one also works: website

1 Like

Thank you for trying to help. Unfortunately, those sites you mention don’t work.

First, I tried this site you recommended to generate a script, and I went to Blocs and created a Code Widget and pasted in that script, but it doesn’t show anything when I preview. Therefore I cannot see how to use it.

Second, the other two websites you recommend do encode the email address properly, but that encoded line of text doesn’t work correctly when I paste it into: Right Sidebar > Interactions > Navigate to URL > URL field. What happens is, when I Export and then preview in Safari, when I click the link, Outlook opens a new email, but the address is badly scrambled and cannot be used. I wonder if this is a bug in Blocs?

@JDW all are working, there you have the file:

Encode Emails.bloc (739.2 KB)

@Pealco Thank you. When I open your Bloc I see this dialog…

So it displays in the browser like this…

@Pealco Forget the above comments for a moment. Try adding a Code Widget inside the body of a Card. You will find it no longer works. That’s the problem I am having.


Hello @JDW, there you have the file with a code inserted in a card:

Encode Emails.bloc (741.9 KB)

About the comments:
The missing Assets, are Brics from the Bloc Store.

  • The Code Snippet Embed
  • Cazoobi Line Divider

The First Site option, you have to inserted directly in the HTML exported page. Not in blocs.

@Pealco, thank you for your help.

I can find Line Divider, but when I search the Blocs Store for “Code Snippet Embed” it does not appear. Do you know why?

I tested your Encode Emails.bloc though and when I preview it works.

I assume that “Code Snippet Embed” is required though. Because if I just add a Code Widget into a Card in my own document, and then paste the code inside your Code Widget into my Code Widget, nothing displays when I preview.

And in preview will not work (using ctrl+V), instead, you have to preview using (comand+alt+b):

The bric is only to show/display the code, not to be used to “work”.
There is the bric link:

Actually, your Bric works! Seriously. It does. I open your Bric in Blocs 3.2.2 and then Preview in Safari, and then I click the “LINK EMAIL” inside the card at the bottom left, and automatically Outlook opens and creates a new email to the correct email address! So yes, your Bric works. But what I am saying is that I cannot recreate your magic in my own document for some reason.

I see you are using a Card. In my document too, I have a Card. I see you are using a Code Widget and Script. I inserted a Code Widget in the Card in my own document and copied/pasted your script. I then previewed my document in Safari, but the link does not display at all. So that is the problem I was trying to explain yesterday. I don’t understand what is special about your Bric that it works, yet in my own document it does not work. Very odd. I’m obviously overlooking something here, but I’m not sure what. Hmmm…