Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bahamas10/node-gmailx
Send email easily on the command line without running a server
https://github.com/bahamas10/node-gmailx
Last synced: 2 months ago
JSON representation
Send email easily on the command line without running a server
- Host: GitHub
- URL: https://github.com/bahamas10/node-gmailx
- Owner: bahamas10
- Created: 2015-07-10T22:46:00.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-29T18:28:04.000Z (almost 8 years ago)
- Last Synced: 2024-08-08T19:13:45.253Z (5 months ago)
- Language: JavaScript
- Homepage: http://www.daveeddy.com/2015/08/24/sending-email-on-the-command-line/
- Size: 4.88 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
gmailx
======Send email easily on the command line without running a server
Installation
------------[sudo] npm install -g gmailx
Usage
-----This tool mimics the behavior of `mailx` but doesn't require any mail pickup
programming running on the current host as it connects (by default) to Google's
free anonymous SMTP server.NOTE: by default, this can only send to gmail accounts!
$ cat message.txt
To: [email protected]
Subject: hello there!This is a test!
$ cat message.txt | gmailx -t
message sent: 250 2.0.0 OK 1436563766 e109si12320482qgf.118 - gsmtpIf you specify a non-gmail address you will see
$ cat message.txt | gmailx -t
Can't send mail - all recipients were rejected
$ echo $?
1You can alternatively construct everything on the command line, ie.
gmailx -a foo.pdf -s 'your document' [email protected] [email protected] <<-EOF
Attached is your pdf
EOFAnd, optionally, specify an alternate server or authorization to use
$ cat config.json
{
"service": "gmail",
"auth": {
"user": "[email protected]",
"pass": "password"
}
}
$ echo hi | gmailx -C config.json -s 'subject' [email protected]See [nodemailer](https://github.com/andris9/Nodemailer#use-direct-transport)
for what can be specified in the config fileCLI Options
$ gmailx -h
Usage: gmailx [-c cc] [-b bcc] [-a attachment/file] to ...Send email easily on the command line without running a server
options
-a, --attachment filename to send as an attachment
-b, --bcc address to bcc to
-c, --cc address to cc to
-C, --config JSON file to be passed to nodemailer.createTransport
-d, --debug turn on debugging information
-h, --help print this message and exit
-r, --from address to email from
-s, --subject subject line to use
-S, --header a raw header to specify
-t, --raw-mode specify To:, From:, Reply-To:, etc. over stdin
-u, --updates check for available updates
-v, --version print the version number and exitLicense
-------MIT License