There is an HTTP field that can be used to send email addresses.
A long time ago, browsers even did this. But it was quickly used
by evil people to harvest those addresses for spam and other
nasty purposes. So nowadays, browsers no longer send out that
information.
Remember, the internet isn't a nice place anymore.
Abigail | [reply] |
Remember, the internet isn't a nice place anymore.
Abigail, does that mean that it used to be?
/me boggles at the thought...
Perhaps you are referring to the pre-internet days.
DARPANET or perhaps even further back when it was ARPANET?
| [reply] |
Yes, the Internet used to be a nice place.
Well, that's my perspective from joining CompuServe in the late 80's and enjoying it till the mid-90's. It was a great community, we had a lot of fun sharing and discussing the news, trying out new software and occasionally :) roasting Microsoft.
I can't complain -- I got my first non-student Internet E-Mail address from them. For a while I was 73067.1500@compuserve.com, before we entered the ISP of the month period of Modern History.
Unfortunately CompuServe's business model started to fail in the second half of the 90's -- charging connect time by the minute (especially at the rate they were charging) made less and less sense. Then, of course, they were bought by AOL.
Fun memories. :)
--t. alex
but my friends call me T.
| [reply] |
| [reply] |
I think your best bet is to have them enter their email, and hope for the best. For verification, pattern match for something that looks like a valid email. Since there are many possibilities: foo@bar.(com | org | edu | gov| uk | org.gy), first.last@foo.bar.com, etc, you'll have to be very creative. As a matter of fact, Mastering Regular Expressions has 10 pages dedicated to this problem, and uses it as a "Let's put everything we've learned in the entire book" example. At the very least, you should make sure there's a '@' and at least one '.' in the address.
If you wanna be more picky, you can start a background mailer that sends a test mail to the address. If it bounces, the address is bogus. This'll look a little odd on their end, and I can't guarantee how they'll react, but it should work.
-Logan
"What do I want? I'm an American. I want more." | [reply] |
I wrote a regexp a little while ago that will validate an email pretty well. It allows for pretty much anything before the '@' except for whitespace and '@', then allows alphanumerics and hyphens in the domain name (with the same rule for n subdomains), then an alphabetical tld. I figured it would be a waste of time to maintain a list of all the tlds, so I just check to make sure the tld has two or 3 letters, or is 'info' or 'museum'.
/^[^@\s]+@([a-z0-9\-]+\.)+([a-z]{2,3}||info||museum)$/i
I would very much like to know if anyone can offer improvements on this, as I plan to use it again soon, but I've tried quite a number of garbage addresses and they're stopped. A limitation of this regexp is that characters like ';' and ',' are not stopped in the first part, so someone could theoretically send extra addresses -- but the '@' is stopped. So, someone could theoretically get your program to send mail to local accounts, or just generate errors. I felt this was an okay compromise, but to stop this you could change the regexp to:
/^[^@\s;,]+@([a-z0-9\-]+\.)+([a-z]{2,3}||info||museum)$/i
Of course, if you really want to validate the address, you could always do a DNS lookup on the domain name (don't laugh, I know people who've done it), but I can't think of any way to check if the address is valid...
LAI
:eof | [reply] [d/l] [select] |
foo" "bar@abigail.nl is a valid address, but it
will be stopped by your regex. There are a few modules on
CPAN that check addresses against RFC 822, for instance
RFC::RFC822::Address.
Abigail
| [reply] [d/l] [select] |
You can get the email address of the sender, if you read email through POP3 etc by yourself, just write some small TCP, socket program.
However a person has a reasonable understanding of SMTP, could easily use a false email address in his outgoing email, so don't rely on that either. | [reply] |