Skip to main content
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: ...
Grajdeanu Alex's user avatar
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 ...
301_Moved_Permanently's user avatar
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: ...
Graipher's user avatar
  • 41k
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 ...
Snowbody's user avatar
  • 8,442
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 ...
301_Moved_Permanently's user avatar
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 ...
janos's user avatar
  • 111k
9 votes
Accepted

Verifying user accounts on SMTP servers

What you really want is a robust argument parsing. This calls for argparse: ...
Graipher's user avatar
  • 41k
9 votes
Accepted

Bash script to truncate subject line of incoming email

Be sure to read the relevant RFCs that govern e-mail headers! Specifically: RFC 2822, Section 1.2.2: Header names are case-insensitive. RFC 2822, Section 2.2.3: Header fields may be line-folded: 2....
200_success's user avatar
9 votes
Accepted

Weekly MySQL database backup

Overall This is totally decent code and not too difficult to maintain. Your variable names make sense and you've made some effort at not repeating yourself, other than the lack of a loop which you ...
chicks's user avatar
  • 2,863
8 votes
Accepted

Using SendAsync to send multiple emails

From the SendAsync docs: After calling SendAsync, you must wait for the e-mail transmission to complete before attempting to send another e-mail message using Send or SendAsync. So no, this ...
RubberDuck's user avatar
  • 30.8k
7 votes
Accepted

E-store automatic email send, to be run daily

There are good and bad things about the code, but I will focus on some things that I believe to be bad about the code. The EmailSenderProgram namespace should be ...
gamesmad's user avatar
  • 336
7 votes

Bash script to truncate subject line of incoming email

Generally good code - plus points for good use of stdout/stderr and exit status. Shellcheck reported some issues: ...
Toby Speight's user avatar
  • 77.3k
7 votes
Accepted

Function to send email, refactored based on SOLID principles

I'd still say that you should break apart the mail message and SMTP client into separate classes for the "Single responsibility principle". In specific: A class should only have a single ...
dmoonfire's user avatar
  • 411
6 votes

C# helper class - mailto

Dmitry Nogin gave a great answer. Here are some ways to improve your original code that could help your coding style in the future. Those private variables holding strings should be constants. ...
Risky Martin's user avatar
  • 1,611
6 votes
Accepted

C# helper class - mailto

We could probably use existing .NET classes here: ...
Dmitry Nogin's user avatar
  • 6,131
6 votes
Accepted

Sending email using libcurl

Here are some things that may help you improve your code. Use required #includes The code invokes gmtime_s, ...
Edward's user avatar
  • 66.5k
6 votes
Accepted

Notification system

As you have already suspected, your code is trying to do too much. Consider separating functionality out into their own distinct concerns. (SRP/SoC -Single Responsibility Principle / Separation of ...
Nkosi's user avatar
  • 3,246
6 votes
Accepted

Mail Crypt Library for encrypted email

Typo seperated_msg -> separated_msg Retrievs -> ...
Reinderien's user avatar
  • 62.8k
6 votes

Weekly MySQL database backup

While you can get away with using this script to dump small databases on a low-traffic site, you should be aware that this is not a good backup technique for safeguarding data in a production system. ...
200_success's user avatar
5 votes
Accepted

Script to send push notifications using email, Pushbullet, or Pushover

Since you’re willing to install third-party packages (I see a pip install -r requirements.txt step in your README), there are a couple of packages you can install ...
alexwlchan's user avatar
  • 8,565
5 votes

Sending email using libcurl

C VS C++ Your question is taged with both C++ and C++14, yet the only C++ part in your code seems to the use of ...
D. Jurcau's user avatar
  • 3,010
5 votes

UnitOfWork for sending mail

I don't know if this falls under "don't do it", but you shouldn't be passing your "container" around. That should be used to wire things up on startup. The rest of your classes should know nothing ...
404's user avatar
  • 2,306
5 votes
Accepted

Sorting email address according to occurrences of each domain

I suggest you get a linter such as Prospector or flake8, this can tell if your code is un-Pythonic. Some people prefer hinters like black. Your code doesn't conform to PEP 8 which is the standard ...
Peilonrayz's user avatar
  • 43.4k
5 votes
Accepted

Mail Crypt CLI encrypted email wrapper for Gmail

You should separate the UI from the actual logic of the program. Whilst a nice UI is cool I believe that it's impeding your ability to structure your code properly. And so I'd recommend making Mail ...
Peilonrayz's user avatar
  • 43.4k
5 votes
Accepted

Email Validation in PHP

First and foremost, regardless of any real or imaginary security issue, this code is a pain in the eye. It's nearly impossible to get the gist of it and to answer the actual question because the code ...
Your Common Sense's user avatar
5 votes

SMTP emailing library

It looks like your email code was written for an older Python version. The email module in the standard library was overhauled ...
tripleee's user avatar
  • 501
4 votes

Emails, emails everywhere

Avoiding raiseing just to rescue immediately ...
Caridorc's user avatar
  • 27.5k
4 votes
Accepted

Validating Email Addresses without DB

As Sjoerd points out in comments, the timestamp generation and checking logic in this code is reimplementing Django's built-in TimestampSigner. Standard ...
Gareth Rees's user avatar
  • 49.6k
4 votes
Accepted

Structuring basic client side / serverside email form

Generally, I think this code looks really good for a pretty basic example of web form handling, particularly for someone who may be earlier in learning process. I think you have really easy to read ...
Mike Brant's user avatar
  • 9,638
4 votes

Asking the user to input a proper email address

Okay so as a general comment, validation like this is fine (well except it's discarding potentially valid addresses with the check for . and the minimum length, but ...
ferada's user avatar
  • 11.1k

Only top scored, non community-wiki answers of a minimum length are eligible