Testing SMTP Settings With Gomtp
/ 2 min read
Updated:Table of Contents
Overview
In this tutorial, you will see how to test SMTP settings with a tool
named gomtp on Linux and macOS cli.
gomtp is a open-source and free software to test SMTP settings. You
can see the source code on the Github
page.
Table of Contents
Install gomtp
To install the gomtp, you can simply run the command below:
sudo curl -L -o /usr/local/bin/gomtp "https://github.com/safderun/gomtp/releases/latest/download/gomtp-$(uname -s)-$(uname -m)" && \sudo chmod +x /usr/local/bin/gomtpSMTP configuration.
To test SMTP settings, you first need to configure a yaml file.
- Create a file named
gomtp.yaml.
vim gomtp.yaml❗The file name must be gomtp.yaml by default.
- Configure the SMTP settings for your needs.
##### Gmail Example #####password: 'appPassword'host: 'smtp.gmail.com'port: 587ssl: falsetls: trueauth: 'LOGIN'subject: 'Testing Email'body: | this is line 1 This is line 2ℹ You can find some other example configurations under the repository.
Test the Configuration
Now it’s time to test the configuration.
-
Be sure that you are in the same directory with the
gomtp.yamlfile you have just created previously. -
Run the
gomtpdirectly with no argument.
gomtp- If the configuration is valid, you will see this output.
$ gomtpEmail sent successfully!- If the configuration is invalid, you will see an error message that describe the problem.
$ gomtp2023/12/21 11:44:33 535 5.7.8 Error: authentication failed: Invalid user or password! 1703148273-WiJ7lX77XKo0