School-Wide Email Sender
A system that gets around student accounts not being allowed to send school-wide emails.

Background
At the end of my first year of high school, it was student council election season, and one of my classmates had volunteered to run. As voting day got closer, our candidate was worried people would forget to vote, so they asked me to help email the whole school with a reminder. But typing in every student ID in the school sounded like a total pain, so I came up with the idea of sending the emails automatically.
How It Works
- Use the SMTP email protocol
- Specify the SMTP server and port
- Start TLS encryption
- Log in to the SMTP server
- Store all the class codes in a list
- Combine each class code and seat number into the address format (e.g.
013314@goo.tyai.tyc.edu.tw) - Send out the friendly reminder
- Close the connection to the server
Reflections
The school-wide reminder campaign was a bit of a flop. When I checked how it went afterwards, it turned out the classes later in the sending order had all gotten the email flagged as spam, which was kind of a bummer. I’d actually seen this coming and set up 5 or 6 extra accounts to spread out the sending, but the real problem was probably that everything went out from my computer on the same IP. If I do it again, I’ll probably send in batches from different networks.
Another issue was that each email had to wait for the server to respond, about 3 seconds per message, which adds up fast when you’re sending that many. Next time, I might try using threading to send them concurrently!