By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,300 Members | 1,867 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,300 IT Pros & Developers. It's quick & easy.

verifying email addresses entered in forms on our intranet

P: n/a
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
Share this Question
Share on Google+
10 Replies


P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.