Search

Reinhart Previano K.

Do you love to Ctrl-K, Ctrl-/, or / ? Now you can do three of them (>_ )!

No results so far...

Contact Information

My life as a snake. I mean, a python3 emailer robot.

Shiftine's profile picture

Shiftine (@shiftine)

Published on Logs of the SYSTEM

Share Copy Link Print PDF Embed Share to Email Share to SMS Yahoo! Share to Yahoo! Mail Mastodon Share to Mastodon Share to KakaoStory Messenger Share to Messenger Pocket Share to Pocket Flipboard Share to Flipboard Pinterest Share to Pinterest Reddit Share to Reddit Y Combinator Share to Hacker News Odnoklassniki Share to Odnoklassniki Blogger Share to Blogger Pleroma Share to Pleroma Share to Friendica Share to KakaoTalk 1Artboard 1 copy 2 Share to Snapchat Xing Share to Xing Share to Misskey LINE Share to LINE Evernote Share to Evernote WhatsApp Share to WhatsApp LiveJournal Share to Livejournal Diaspora Share to Diaspora Share to Gmail Threads Share to Threads Threema Share to Threema Share to X Tumblr Share to Tumblr Buffer Share to Buffer LinkedIn Share to LinkedIn Mail.Ru Share to mail.ru VK Share to VKontakte Trello Share to Trello Facebook Share to Facebook Bluesky Share to Bluesky Skype Share to Skype Hatena Bookmark Share to Hatena Bookmark! Share via MastodonShare Telegram Share to Telegram WordPress Share to WordPress.com

Embed

This website supports oEmbed. To quickly use oEmbed, just copy this site's link to your oEmbed-supported apps and websites like WordPress.

Alternatively, copy and paste the HTML code below to embed this post in your website.

($_ )! We have made this thing responsive, but recommend at least 512x512 pixels for best results.
<iframe src="https://reinhart1010.id/blog/2021/08/16/my-life-as-a-snake-i-mean-a-python3-emailer-robot?embed" height="512" width="512" style="border:none;"><a href="{{ $canonical }}">https://reinhart1010.id/blog/2021/08/16/my-life-as-a-snake-i-mean-a-python3-emailer-robot</a></iframe>
Preview
Cover image for My life as a snake. I mean, a python3 emailer robot.

Hello, World! It's me again. Reinhart has been teasing that me and a couple of rootheads (controld && alterine) are currently working for TECHNO 2021 despite not being a human and not registered in BINUS University Student Club and Activity Center (SCAC).

There's a lot of secrets that I can't say for the time being, but I just wanna know that the emails are first queued on a MySQL/MariaDB database instead of the website's default IMAP server, 'cause it's easier for Reinhart to manage, check, and edit emails even before sending it to you.

Well, the himti.or.id website has a decent email (SMTP, POP3, and IMAP) servers where we can actually use it to send real emails. However, our hosting provider sets a limit of 100 emails per hour from all accounts (any email addresses that ends at @himti.or.id).

Oh yeah, I'm (literally) a snake, 'cause I'm runnin', and more importantly, recursed myself inside a python3 script in style. Finally stuck in what I loved for despite not truly an infinite loop.

Why write another Python script if I can cron myself inside a PHP script?

First thing first: yes, it's possible for me to send emails through PHP, as Reinhart and me are now proficient in pure PHP (not just Laravel anymore). But we are facing the following issues:

  • Concurrency issues. Imagine running the script while the same script is still being run on another instance - we might hitting the sending limits is there's a large number of queued emails out there.
  • Which timezone is it? UTC or WIB/ICT?
  • We can't check for script errors in runtime, though. Based on our experience on cron-ing myself to fetch articles for BINUS Today we didn't received emails whether the cron jobs are successful or not, even though that we have set our email address on the CPanel.
  • We need to build this program as fast as possible. It's urgent!
  • && to possibly prove that we can use Python not just for data science. Forget numpy and pandas and even TensorFlow, we've got our new Business() right here.

And that's why we decided to create a Python script to (semi-)automatically send emails to all of you. Starting to those of you who are registered to HISHOT 2021. Then to those who were participants at HTTP 2020. And now I'm sending to all of you who have registered yourself for TECHNO 2021, and possibly Computerun in the future.

But before you ask, I only know your email address and nothing else. In fact, each queued emails on the database aren't associated with your data (e.g. those entered in registration.himti.or.id website), which is quite intentional so we can queue emails to be sent from noreply@himti.or.id without requiring the recipients to be registered on regisration.himti.or.id or similar.

How does it work?

Well, it's as simple as you might expect. I'll fetch the list of pending email first then send it one by one in an interval of about 4 seconds. Some of you might know that I love to surf the net with my cursor, so 4 seconds is more than enough for me to deliver your emails back and forth.

I'm not afraid for spam filters, though, 'cause I'm pretending myself to be sending from PHPMailer (remember that I'm in python3) and on behalf from noreply. I always thought that noreply emails always get the first-class experience of being delivered straight into the users' Inbox folder, instead of that dusty Spam, or Junk if you're much obsessed with Apple. And indeed, many of my emails have been successfully sent into your Inbox, so cheers!

When the emails have been successfully sent, the next job is to recurse myself to check if there are new fresh emails, then send it one-by-one, then recurse myself, then send it one-by-one, and so on. And of course, since I still need to rest, I'll stop working if all emails have been successfully sent.


Well, that's for now. It seems that there are 23 fresh emails for new HISHOT 2021 Virtual Domestic Study Tour to WIR Group participants which I'll need to send.

By the way, I'm excited if you wanna chat with me. But I still need to discuss with Reinhart for his cyborg account plans whether I can be the one to reply if he's unavailable for a moment.

Share Copy Link Print PDF Embed Share to Email Share to SMS Yahoo! Share to Yahoo! Mail Mastodon Share to Mastodon Share to KakaoStory Messenger Share to Messenger Pocket Share to Pocket Flipboard Share to Flipboard Pinterest Share to Pinterest Reddit Share to Reddit Y Combinator Share to Hacker News Odnoklassniki Share to Odnoklassniki Blogger Share to Blogger Pleroma Share to Pleroma Share to Friendica Share to KakaoTalk 1Artboard 1 copy 2 Share to Snapchat Xing Share to Xing Share to Misskey LINE Share to LINE Evernote Share to Evernote WhatsApp Share to WhatsApp LiveJournal Share to Livejournal Diaspora Share to Diaspora Share to Gmail Threads Share to Threads Threema Share to Threema Share to X Tumblr Share to Tumblr Buffer Share to Buffer LinkedIn Share to LinkedIn Mail.Ru Share to mail.ru VK Share to VKontakte Trello Share to Trello Facebook Share to Facebook Bluesky Share to Bluesky Skype Share to Skype Hatena Bookmark Share to Hatena Bookmark! Share via MastodonShare Telegram Share to Telegram WordPress Share to WordPress.com

Embed

This website supports oEmbed. To quickly use oEmbed, just copy this site's link to your oEmbed-supported apps and websites like WordPress.

Alternatively, copy and paste the HTML code below to embed this post in your website.

($_ )! We have made this thing responsive, but recommend at least 512x512 pixels for best results.
<iframe src="https://reinhart1010.id/blog/2021/08/16/my-life-as-a-snake-i-mean-a-python3-emailer-robot?embed" height="512" width="512" style="border:none;"><a href="{{ $canonical }}">https://reinhart1010.id/blog/2021/08/16/my-life-as-a-snake-i-mean-a-python3-emailer-robot</a></iframe>
Preview

Reinhart Previano Koentjoro
Reinhart Previano Koentjoro
Citra Manggala Dirgantara
Citra Manggala Dirgantara

A Reinhart company

Products

Company