How to send test mails from Lua using GMail Account

Aswin Vijayakumar
Apr 1 · 1 min read

Lua is a scripting language that is fast and has a programming paradigm that is easy to learn.

I was trying to test an email sending process using a new language. I have tried in PHP using sendmail program. Lua works differently and uses OpenResty.

Clone this repository:

git clone

Then follow the instructions on the page and change the make test command header.

Comment out — exclude_tags=integration_externaland include — exclude_tags=integration_internal

This will execute the spec file mail_integration_internal_spec.lua

Set up the environment details for SMTP Gmail Account and change the from address.

Your GMail Account

  1. Navigate to your Google Account.

Then, Click Generate.

Now, add your password to the Lua program and enjoy sending emails.

Nerd For Tech

From Confusion to Clarification

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store