Simple Bulk Email Sender

Simple bulk email sender. A command line utility to send bulk email to your mailing lists right in your terminal.
Features
- Multiple accounts: Save access of multiple accounts in one place
- OAuth: Connect with the GC API to send emails with your Gmail account
- Easy to use: Every single command guide you through the configuration
- Portable: Everything sits inside a single json file
Installation
You will need Go at least 1.2x. Afterwards you can go install
sbes.
go install github.com/otaleghani/sbes
Basic usage
Every single command waits for your input, so you don't have to learn a bunch of flags.
To get started, add a new account with add account
. It will ask for your username, password, SMTP host and port. Your data is store locally and never leaves your pc.
sbes add account
You can then add a new OAuth2 token for your account. This is optional, but it's required with some email providers, like Gmail. You will need to generate from Google Cloud a new project and get the OAuth2 Client Id and Secret. You can find a more in-depth explaination at How to setup OAuth2. Currently only GMail API is supported.
sbes add oauth-client # Adds a new OAuth2 client
sbes add oauth-token # Adds token to an existing account
Afterwards you will need to specify a mailing list and a message to send. Here you will need a .csv
file for the mailing list and either a .txt
or .html
file for the message. Provide to sbes the absolute path.
Every single data is saved on a .json
file, so you can even make sbes portable.
sbes add mailing-list
sbes add message
Finally you can specify to sbes which message to send from which account to which mailing list.
sbes send password
sbes send oauth
How to setup OAuth2
To use OAuth2 with gomail.v2, you'll need to:
- Set up a Google Cloud Project and enable the Gmail API.
- Obtain OAuth2 credentials.
- Add the OAuth Client to sbes
1. Set up a Google Cloud Project and enable the Gmail API
- Go to the Google Cloud Console.
- Create a new project.
- Enable the Gmail API for the project.
- Set up the OAuth consent screen.
2. Obtain OAuth2 credentials
- In the Google Cloud Console, go to Credentials.
- Create OAuth 2.0 Client IDs. Choose "Web application" as the application type.
- Add redirect URI, that would be
http://localhost:8080
and http://localhost:8080/oauth2callback
- Save this new OAuth Client and the Id and Secret should pop out.
3. Add the OAuth Client to sbes
- Go back to your terminal
- Create a new OAuth Client into sbes (
sbes add oauth-client
) using your newly created Id and Secret
You can now generate a new token for an account by using sbes add oauth-token
. You will be promped with selecting the account that you want to authenticate with OAuth and a OAuth Client. Afterwars you will need to visit localhost:8080 and follow up with the OAuth consent screen.
This first run adds both a Refresh token and an Access token. The Access token is valid for 1 hour and does not refresh automatically (as of now). To refresh it you will need to use the cmd sbes refresh
. After you indicate what account you want to refresh, it will update the access token with a new one.
When the Refresh token runs out (every 7 days), you will need to call the sbes add oauth-token
again.
Availables commands
-
add
- Adds either a new account
, mailing-list
, message
, oauth-client
or oauth-token
-
delete
- Deletes either an account
, mailing-list
, message
, or oauth-client
-
list
- Lists either an account
, mailing-list
, message
, or oauth-client
-
send
- You will need to specify either password
or oauth
for the authentication method.
Planning for future versions
0.1.1