35
votes
Regex validation for Email Address
I remember having read somewhere (possibly in another Code Review answer) that for an e-mail address, the simplest and most effective validation you can do is to make sure it contains an ...
32
votes
Accepted
Accurate email syntax validation (no seriously)
"@"@example.com and "\ "@example.com both fail, but they are valid.
...
27
votes
PHP mail form is being abused
Your script is vulnerable to a header-splitting attack. Due to the poor design of PHP's mail() function, it is actually quite easy to introduce that kind of ...
24
votes
Accurate email syntax validation (no seriously)
Said this in chat already, but @ succeeds even although it is not a valid email address. You should require at least 1 character in the local part and 1 character ...
24
votes
Accurate email syntax validation (no seriously)
I personally find it hard to fault your code.
Actually I'm quite surprised about the absence of code.
Other than a few PEP8 errors there are three changes that I would recommend.
You remove both <...
22
votes
Accepted
Send daily email alerts of the Bitcoin Price
Define some constants
I'd make some constants and put them at the top of the program because if your program becomes bigger, it'll be harder to change their values:
...
20
votes
Regex validation for Email Address
As @Simon pointed out, your regular expression might consider some valid addresses as invalid.
Per this source which I've found somewhere on this Stack Overflow page, this would be RFC5322-compliant:
...
19
votes
Accepted
PHP mail form is being abused
I'm not a php expert, but from reading up on the documentation it appears that it may be possible to insert additional from/to addresses using the "Additional Headers" field on the ...
17
votes
Email validation using JavaScript
I disagree with rolfl's assertion that, "There is no practical way to validate an e-mail address by regex alone."
He is correct—as illustrated by the somewhat infamous SO answer he linked to—that it'...
17
votes
E-mail testing code
First, heed what Jeroen Vannevel said; it will save you much grief.
Of all the assumptions you've made here, only one is correct: there
has to be an @ in the ...
17
votes
Accurate email syntax validation (no seriously)
You seems to build your module to contain only validate as "public" function. You may want to enforce that by declaring ...
16
votes
Send daily email alerts of the Bitcoin Price
It seems to me that running a specific command at a specific time each day is more the job of a cron daemon than of said command. As such, I would simplify the ...
15
votes
Send email just once per day
Couple of remarks:
IsSent() smells like a property, not a method. It should be more descriptive as well: what object are you calling this on? It seems to indicate ...
14
votes
E-mail testing code
Email validation aside...
Switching between GUI input and console output
You take your input via a JOptionPane, but the output of your validation is displayed via ...
13
votes
Regex validation for Email Address
It was suggested that I move this to an answer instead of a comment:
Since you're using .NET, why not just use System.Net.Mail.MailAddress? It already performs ...
13
votes
Telling me what lesson I have tomorrow and emailing me the results
I would change the data organization to be the opposite way, to have a dict mapping to the two week types containing a dict with a mapping from the weekday to the lessons:
...
12
votes
Accepted
HTML inline CSS
Broken HTML
Browsers are forgiving. I see a fairly nice looking page,
but the truth is, this HTML is seriously broken.
...
12
votes
Accurate email syntax validation (no seriously)
The code that you've written is generally really good, but as you seem to have found parsing non-trivial strings starts to get kind of complicated, and has all sorts of room for nasty edge cases.
Your ...
12
votes
Accepted
Analyze frequency and content of political fundraising E-mails
Let's start with the obvious: this code doesn't run. You're missing ans = starter() so that further (el)if ans.lower() == ... ...
11
votes
Accepted
Application please send me an E-mail
Some thoughts about the code itself.
In general method names recommended as Pascal Case so sendEmail should ideally be named ...
11
votes
Accepted
Network Downtime
Argument handling
$defaultmail and $defaultip are poorly named — there is a naming inconsistency:
...
11
votes
Accepted
Are your servers down...?
I'll proceed top to bottom.
mail_error
Which would you rather read: x.body = e.message or ...
10
votes
Send email just once per day
Normally, you don't catch Exceptions to throw them again, it doesn't make sense, let them rise up, don't catch them here, I don't think it is your intention to stop the exceptions here, so don't.
...
10
votes
Accepted
Replace many Outlook email rules with a script
Here's some changes I would make.
First thing I would do is make most of this module level variables, initialized in your Application_startup method, and taking advantage of WithEvents to setup the ...
10
votes
Accepted
Sending text and HTML email using smtplib & MIMEText
The goals of this will be to make the code more readable and maintainable.
Don't put templates and credentials in your code.
Most of the class-level declarations of ...
10
votes
Accepted
Python program that obfuscates an email address
The code is straightforward and reads well, but:
string concatenation is not very efficient, especially in a loop. You'd be better off using str.join on an ...
9
votes
PHP mail form is being abused
Never, EVER directly use a $_GET or $_POST variable without checking its content first. Instead of:
...
9
votes
Email checker ('@' sign, provider, domain extension)
My first comment would probably be that you shouldn't try to validate emails beyond checking that they have at least one character before an @ sign, one ...
9
votes
Accepted
Simple email validation script
Interface design
The current design of the validator class is not very intuitive.
Users of this class must call the check_for_symbol and ...
9
votes
Accepted
Verifying user accounts on SMTP servers
What you really want is a robust argument parsing. This calls for argparse:
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
email × 285python × 74
php × 60
c# × 42
java × 32
beginner × 26
python-3.x × 26
validation × 25
html × 20
security × 19
performance × 16
ruby × 15
javascript × 14
object-oriented × 13
python-2.x × 13
form × 12
.net × 9
parsing × 8
multithreading × 7
regex × 7
asynchronous × 7
linux × 7
status-monitoring × 7
vba × 6
bash × 6