473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

verifying email addresses entered in forms on our intranet

I'm doing a rough validation of an email address client-side (using js),
but it's not enough - our customer service people are apparently
incapable of typing in an email address without error - we get spaces,
missing '@', multiple '@' which we can field, and simple mis-spellings,
which we can't.

I'd like to automate a 'mailto:' popup for them on submit, along the
lines of "thanks for your email address, just verifying I've got it right".

Two questions:
1. How do I automate the pop-up - javascript window.open(url) works, but
leaves an unwanted residual blank browser page; window.href=,
window.location=, window.location.href=, and window.open(url,"_self")
all appear to do nothing - I suspect the form submission immediately
afterwards wipes it out before it does the mail pop-up.

2. I've seen advice about "don't use subject & body in mailto: urls" -
which browsers do they/don't they work in (this is an intranet page, so
I can reasonably rule out some browsers if necessary, but I'd like to
know which).

Thanks,
Chris
Jul 20 '05 #1
10 3536
On Mon, 02 Feb 2004 15:01:44 +0000, Chris Sharman
<ch***********@sorry.nospam> wrote:

...
2. I've seen advice about "don't use subject & body in mailto: urls" -
which browsers do they/don't they work in (this is an intranet page, so
I can reasonably rule out some browsers if necessary, but I'd like to
know which).


It's more likely that specific combinations of browsers and mail clients
cause problems. Browsers with built-in mailer are not likely to have
trouble with this format.

--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won't get any real work done. - J.Nielsen
Jul 20 '05 #2

"Chris Sharman" <ch***********@sorry.nospam> wrote in message
news:bv*******************@news.demon.co.uk...
I'm doing a rough validation of an email address client-side (using js),
but it's not enough - our customer service people are apparently
incapable of typing in an email address without error - we get spaces,
missing '@', multiple '@' which we can field, and simple mis-spellings,
which we can't.

I'd like to automate a 'mailto:' popup for them on submit, along the
lines of "thanks for your email address, just verifying I've got it right".
Two questions:
1. How do I automate the pop-up - javascript window.open(url) works, but
leaves an unwanted residual blank browser page; window.href=,
window.location=, window.location.href=, and window.open(url,"_self")
all appear to do nothing - I suspect the form submission immediately
afterwards wipes it out before it does the mail pop-up.

2. I've seen advice about "don't use subject & body in mailto: urls" -
which browsers do they/don't they work in (this is an intranet page, so
I can reasonably rule out some browsers if necessary, but I'd like to
know which).


Instead of a mailto: link, provide an HTML form, fill it in automatically,
and when the Send button is pressed, send the mail from your server-side web
application.

Jul 20 '05 #3
Harlan Messinger wrote:
1. How do I automate the pop-up - javascript window.open(url) works, but
leaves an unwanted residual blank browser page; window.href=,
window.location=, window.location.href=, and window.open(url,"_self")
all appear to do nothing - I suspect the form submission immediately
afterwards wipes it out before it does the mail pop-up.


Instead of a mailto: link, provide an HTML form, fill it in automatically,
and when the Send button is pressed, send the mail from your server-side web
application.


Should have mentioned - I considered that, but current after-the-fact
central fielding of bounced emails simply doesn't work (nobody takes
ownership). I want to keep the bounce, and the responsibility, with the
form user, which means using their email account to send. Much easier
(IMHO) to do that client-side, rather than figuring out & spoofing their
sender address from server-side.

Thanks,
Chris
Jul 20 '05 #4
Chris Sharman <ch***********@sorry.nospam> wrote in message news:<bv*******************@news.demon.co.uk>...
I'm doing a rough validation of an email address client-side (using js),
but it's not enough - our customer service people are apparently
incapable of typing in an email address without error - we get spaces


Spaces are actually allowed in e-mail addresses, see RFC 2822 3.4.1.
The following is valid for example:

"some text containing spaces"@example.com

Some people use address like this to avoid spam - spam spiders would
see the above and try to send e-mail to spaces"@example.com.

--- Safalra (Stephen Morley) ---
http://www.safalra.com/hypertext
Jul 20 '05 #5
Safalra wrote:
Chris Sharman <ch***********@sorry.nospam> wrote in message news:<bv*******************@news.demon.co.uk>...
I'm doing a rough validation of an email address client-side (using js),
but it's not enough - our customer service people are apparently
incapable of typing in an email address without error - we get spaces

Spaces are actually allowed in e-mail addresses, see RFC 2822 3.4.1.
The following is valid for example:

"some text containing spaces"@example.com

Some people use address like this to avoid spam - spam spiders would
see the above and try to send e-mail to spaces"@example.com.


I'm aware of the theoretical possibility, and when I hear of a customer
that really wants a space in his email address, I'll fix it. Meantime I
see several a week that have accidental spaces (in the domain as often
as not) which need removing.

This is OT anyway - the question is how to popup a mailto: url within
the onsubmit processing, and which browsers can/can't handle the rfc
compliant subject & body parts.

The popup works if I open a new window, but then I'm left with an
unwanted new empty window - if I do it inline, it seems (I'm guessing)
to be overwritten by the form post response before the mail client is
fired - perhaps I need to get clever with the timing, but I'm not sure how.

I've googled around browser compliance, and while there's plenty of
articles on html & css compliance, I've not found any mention of mailto:
protocol compliance/support.

Thanks anyway,
Chris
Jul 20 '05 #6
On Mon, 2 Feb 2004, Chris Sharman wrote:
I'm doing a rough validation of an email address client-side (using js),
but it's not enough - our customer service people are apparently
incapable of typing in an email address without error - we get spaces,
missing '@', multiple '@' which we can field, and simple mis-spellings,
which we can't.

I'd like to automate a 'mailto:' popup for them on submit, along the
lines of "thanks for your email address, just verifying I've got it right".

Two questions:
1. How do I automate the pop-up - javascript window.open(url) works, but
leaves an unwanted residual blank browser page; window.href=,
window.location=, window.location.href=, and window.open(url,"_self")
all appear to do nothing - I suspect the form submission immediately
afterwards wipes it out before it does the mail pop-up.

2. I've seen advice about "don't use subject & body in mailto: urls" -
which browsers do they/don't they work in (this is an intranet page, so
I can reasonably rule out some browsers if necessary, but I'd like to
know which).


I don't know about doing that in javascript (a BAD idea in my opinion), but here
are the basic steps that I go through in a PHP script for mailbox
"verification":

1) Separate the mailbox address into its two components: A "user" part and a
domain. In doing this, one verifies:
a) That the "user" part is not null (of zero length).
b) That the domain is not null.
c) That there is only one "@" present. strchr() == strrchr() when
not null itself will do it.

2) For the domain: Make certain that it represents a "reachable" host.
a) Resolve any CNAME references for the domain.
b) Require one of the following DNS records: A, AAAA, A6, or MX.

At this point, you still don't know if there's mail service at the host (with
MX, there should be - at the designated server(s)). However, the only way to
verify the "user" part would be to connect and either "ask" (via SMTP commands
VRFY or EXPN, if allowed) or to start a mail session, but abort the mail at the
"DATA" subcommand.

Technically, that doesn't guarentee a valid user portion, if an MX server will
accept "anything" (i.e. it doesn't check - and only the final destination server
does) or if some feature requires a complete message (e.g. "delayed checks").

Personally, I find the domain check sufficient in most cases.

Javascript is in general a bad idea because most people who KNOW what they're
doing DISABLE it for security reasons.
Jul 20 '05 #7
Chris Sharman wrote:
I'm aware of the theoretical possibility, and when I hear of a customer
that really wants a space in his email address, I'll fix it. Meantime I
see several a week that have accidental spaces (in the domain as often
as not) which need removing.


What's worse is how some sites and programs decide to "validate" the top
level domain of an e-mail address somebody entered, and the author was
sufficiently clueless to think that all TLDs are two or three letters
long; such things reject my .name and .info addresses. Very annoying.

--
== Dan ==
Dan's Mail Format Site: http://mailformat.dan.info/
Dan's Web Tips: http://webtips.dan.info/
Dan's Domain Site: http://domains.dan.info/
Jul 20 '05 #8
Tim
On Tue, 03 Feb 2004 09:37:41 +0000,
Chris Sharman <ch***********@sorry.nospam> wrote:
I've googled around browser compliance, and while there's plenty of
articles on html & css compliance, I've not found any mention of mailto:
protocol compliance/support.


You'll find dodgy support for it. Technically, it requires integration
between an e-mail client and the web browser, which doesn't apply to all
users (it requires "working" integration, not just a browser and mail
client on the same PC, which isn't compulsory). Logistically, it also
requires that the sender has an e-mail account (they have to send from
an address).

Either case presents a problem for someone trying to send a message when
they don't have their own computer (e.g. at a friend's place, or at
work, or at the library, etc.).

--
My "from" address is totally fake. The reply-to address is real, but
may be only temporary. Reply to usenet postings in the same place as
you read the message you're replying to.

This message was sent without a virus, please delete some files yourself.
Jul 20 '05 #9
D. Stussy wrote:
On Mon, 2 Feb 2004, Chris Sharman wrote: {snip}
Two questions:
1. How do I automate the pop-up - javascript window.open(url) works, but
leaves an unwanted residual blank browser page; window.href=,
window.location=, window.location.href=, and window.open(url,"_self")
all appear to do nothing - I suspect the form submission immediately
afterwards wipes it out before it does the mail pop-up.

2. I've seen advice about "don't use subject & body in mailto: urls" -
which browsers do they/don't they work in (this is an intranet page, so
I can reasonably rule out some browsers if necessary, but I'd like to
know which).


{snip} For the domain: Make certain that it represents a "reachable" host.
a) Resolve any CNAME references for the domain.
b) Require one of the following DNS records: A, AAAA, A6, or MX.
Interesting, and worth considering, but almost completely irrelevant to
the question - would anyone care to address my two questions,
particularly the first.
Javascript is in general a bad idea because most people who KNOW what they're
doing DISABLE it for security reasons.


This is intranet, as I said - no security issue.
Many of our customers' emails are simply <username>@<isp> - your domain
validation is a good idea, but doesn't do much for them.

Thanks,
Chris
Jul 20 '05 #10
Chris Sharman wrote:

when I hear of a customer that really wants a space in his email
address, I'll fix it. Meantime I see several a week that have
accidental spaces (in the domain as often as not) which need
removing.

This is OT anyway - the question is how to popup a mailto: url
within the onsubmit processing,


using javascript? Then your question is off-topic, too. Perhaps try a
javascript group.

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: mcp6453 | last post by:
I'm posting in desperation and hopes that someone has a script that will achieve these objectives: 1. Web interface using forms collects Name, Address, Email Address. 2. Web interface sends this...
7
by: JR | last post by:
Hey all, I have read part seven of the FAQ and searched for an answer but can not seem to find one. I am trying to do the all too common verify the data type with CIN. The code from the FAQ...
117
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
2
by: Jim Fox | last post by:
Thought maybe I could do this with a hyperlink field in a table...........but doesn't seem to be working. I basically got a vendors table with all the contact info. One of the fields is EMAIL...
6
by: John | last post by:
Hi I have several web forms that require users verification by entering a code before they are allowed in. I have created a separate web form for entering and verifying user code. How do I...
4
by: wayne | last post by:
I have a PHP email script running on two separate websites. Today, I received a form mail generated by the script from each site, with time stamps 10 minutes apart. The entered email address in...
4
by: Ron | last post by:
I have this code on one of my forms, the code takes whatever is in textboxes and adds it to a MS Access Database. It then shows a message that the operation was completed. Is there a universal...
4
by: Tony M | last post by:
VS 2005 - XP media - VB .net - winforms - .net 2.0 Just trying to send an email, here is the code and the error message that I get. I can't figure out how to fix it?
3
by: jammydodger2 | last post by:
Ok, so i am using this code (see below) to open up a new email message with all my listed clients e-mail addresses in the bcc field. Pleblem is some of the clients do not have an email address so...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.