email-validation

Generating confirmation code for an email confirmation

99封情书 提交于 2019-11-27 10:21:33
Using PHP, what are some ways to generate a random confirmation code that can be stored in a DB and be used for email confirmation? I can't for the life of me think of a way to generate a unique number that can be generated from a user's profile. That way I can use a function to make the number small enough to be included in the URL ( see this link ). Remember, the user has to click on the link to "confirm/activate" his/her account. If I can't use numbers, I have no problems using both letters and numbers. With that said, I've tried hashing the username along with a "salt" to generate the

Using MX records to validate email addresses

人走茶凉 提交于 2019-11-27 07:53:18
Scenario: I have a contact form on my web app, it gets alot of spam. I am validating the format of email addresses loosely i.e. ^.+@.+\..+$ I am using a spam filtering service (defensio) but the spam scores returned are overlapping with valid messages. At a threshold of 0.4 some spam gets through and some customer's questions are wrongly thrown in a log and an error displayed. All of the spam messages use fake email addresses e.g. zxmzxm@ywduasm.com Dedicated PHP5 Linux server in US, mysql, logging spam only, emailing the non spam messages (not stored). Proposal: Use php's checkdnsrr(preg

Javascript multiple email regexp validation

孤人 提交于 2019-11-27 07:43:44
问题 Normally validation of simple email is: /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/ This will validate email like test@test.com But how to validate if email is multiple? entry 1: test@test.com, test1@test.com, test2@test.com entry 2: test@test.com , test1@test.com , test2@test.com entry 3: test@test.com, test1@test.com , test2@test.com entry 4: test@test.com This emails is a possible entries that user will input. Also expect thier is 2 or 3 or 4 or more emails sometimes.

How to block Disposable Email Addresses in your website's registration form?

做~自己de王妃 提交于 2019-11-27 07:27:06
I would like to know of the possible ways to block disposable email addresses from registering in my website. For simplicity, let's take the example where the registration form of the website is done with HTML and PHP. Any ideas, solutions or suggestions would be greatly appreciated. This is tough, because neither whitelisting nor blacklisting are an option. By whitelisting certain domains, you disallow people with email domains that are unknown to you (but might be perfectly valid), while by blacklisting you have to update the list of blacklisted domains on a daily basis, since new "10 minute

How should I validate an e-mail address?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 07:11:14
问题 What's a good technique for validating an e-mail address (e.g. from a user input field) in Android? org.apache.commons.validator.routines.EmailValidator doesn't seem to be available. Are there any other libraries doing this which are included in Android already or would I have to use RegExp? 回答1: Don't use a reg-ex. Apparently the following is a reg-ex that correctly validates most e-mails addresses that conform to RFC 2822, (and will still fail on things like "user@gmail.com.nospam", as will

What's wrong with this RegEx for validating emails?

一世执手 提交于 2019-11-27 06:51:45
问题 Here's a regex for validating emails - \S+@\S+\.\S+ , I didn't write it. I'm new to Regular Expressions and do not understand them all that well. I have a couple of questions: What's wrong with the above RegEx? What's a good RegEx for validating emails? 回答1: "How do I validate an email with regex" is one of the more popular questions that come up when it comes to regular expressions and the only real good answer is "you don't". It has been discussed in this very website in many occasions.

How to check if an email address is fake ?

元气小坏坏 提交于 2019-11-27 05:59:30
问题 I need to know how check if email address is valid without using link in email confirmation. How can I do this? 回答1: You can't, end of story. Even using email confirmation only proves that the email address was valid at that time. It could then be shut down a second later! Same for any other Internet based ID systems like OpenID, they can be set up and shut down just for the duration of the registration process. Even credit card ID can be one off since the invention of the disposable "debit"

Email validation on textField in iOS

為{幸葍}努か 提交于 2019-11-27 05:57:49
In iOS App, how to add Email validation on UITextField? Rog Use NSPredicate and Regex: - (BOOL)validateEmailWithString:(NSString*)email { NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; return [emailTest evaluateWithObject:email]; } For a bunch of emails separated by a comma: - (NSMutableArray*)validateEmailWithString:(NSString*)emails { NSMutableArray *validEmails = [[NSMutableArray alloc] init]; NSArray *emailArray = [emails componentsSeparatedByString:@","]; for (NSString

Email validation using regular expression in JSF 2 / PrimeFaces

让人想犯罪 __ 提交于 2019-11-27 03:56:58
I have an input field taking an email address: <h:inputText value="#{register.user.email}" required="true" /> How can I validate the entered value as a valid email address using regex in JSF 2 / PrimeFaces? Here is how: Using it myself... <h:inputText id="email" value="#{settingsBean.aFriendEmail}" required="true" label="Email" validatorMessage="#{settingsBean.aFriendEmail} is not valid"> <f:validateRegex pattern="[\w\.-]*[a-zA-Z0-9_]@[\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]" /> </h:inputText> <p:message for="email" /> Daniel. All regular expression attempts to validate the email

How long can a TLD possibly be?

泄露秘密 提交于 2019-11-27 00:59:55
I'm working on an email validation regex in PHP and I need to know how long the TLD could possibly be and still be valid. I did a few searches but couldn't find much information on the topic. So how long can a TLD possibly be? tripleee DNS allows for a maximum of 63 characters for an individual label. Dan Dascalescu The longest TLD currently in existence is 24 characters long, and subject to change. The maximum TLD length specified by RFC 1034 is 63 octets. To get the length of the longest existing TLD: wget -qO - http://data.iana.org/TLD/tlds-alpha-by-domain.txt | tail -n+2 | wc -L Here's