GithubHelp home page GithubHelp logo

email's Introduction

Send Email

Send email from the command line using PHP's smtp, mailgun, mandril or other drivers.

`email [email protected] --subject='Test Subject' --body='Test Body'`

Installation

Simply download the email.phar and move to the location of your preference.

wget https://github.com/mreschke/email/raw/master/email.phar -O /usr/local/bin/email
chmod a+x /usr/local/bin/email

Then run /usr/local/bin/email just once for the first time and it will automatically create a user based configuration file in ~/.config/mreschke/email which you will need to edit with your mail driver and API keys.

If you prefer a global config file vs a user based config, simply sudo mkdir /etc/mreschke & sudo mv ~/.config/mreschke/email /etc/mreschke. The email system will always use the user config first if exists.

Usage

Run email with no parameters to see help and usage information.

Email console command
Copyright (C) 2016 mReschke.com
This program may be freely redistributed under the terms of the MIT license.

Send email from the command line using PHP's smtp, mailgun, mandril or other drivers.

Options:
 --to             Add recipients (one or more --file or , separated string)
 --cc             Add cc recipients (one or more --file or , separated string)
 --bcc            Add bcc recipients (one or more --file or , separated string)
 --subject        Email subject
 --text           Email body (as text not html)
 --html, --body   Email body (as html)
 --file           Add attachment (one or more --file or , separated string)
 --from           Override from address defined in config file
 --driver         Override driver defined in config file
 -v, --version    Show version
 -h, --help       Show help and usage

If no --text, --html or --body is define, it will assume STDIN

Examples:
 email [email protected] --subject='Hi' --body='Sup'
 email [email protected] --subject='Hi' --text="$(cat /tmp/file.txt)"
 cat /tmp/file | email [email protected] --subject='Hi'
 uname -a | email [email protected] --subject='Hi'
 email [email protected] [email protected] --subject='Hi' --body='There' --file=/tmp/file.txt
 email [email protected],[email protected] --subject='Hi' --body='There'
 email [email protected] [email protected] --subject='Hi' --body='There'
 email [email protected] --subject='Hi' --body='There' --from='Me <[email protected]>'
 email [email protected] --subject='Hi' --body='There' --driver=smtp

There is also a shorthand notation without using any -- (last file argument is optional)
 email [email protected] 'Subject' 'Body Here'
 email [email protected],[email protected] 'Subject' 'Body Here'
 email [email protected] 'Subject' 'Body Here' /tmp/file.txt
 email [email protected] 'Subject' 'Body Here' /tmp/file.txt,/tmp/file2.txt

Compile Yourself

Install https://github.com/box-project/box2 globally, then from the main email directory (not src) run box build. This creates a new ./email.phar.

email's People

Contributors

mreschke avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.