*! version 1.1 August8, 2014

Title

emailme -- This user-written command allows Stata users to send custom emails and/or text messages within a do file using Window's Powershell.exe and a Gmail account.
Typically helpful for sending messages after a long job. See notes, below, before running for the first time. Email attachments not supported.

Syntax

emailme

, username() password() from() [subject() body() alternate()]

Main
* username Gmail username (before the '@' symbol)

* password Gmail password (see Note 2)

* from From, in 'xxxxxxx@gmail.com' format

subject Subject line

body Email Body text

alternate Secondary email address or text address (see Note 3)

* Required.

Notes

Note 1: This command requires that you allow user-written scripts in Window's Powershell. To do this, type 'winexec powershell.exe' in Stata. In the window that opens, type 'Set-ExecutionPolicy RemoteSigned' (without quotes) and confirm with `y'. IMPORTANT. While this does NOT allow downloaded scripts to be run, this could still make your computer more vulnerable to malicious scripts written on your computer. Use this ado with appropriate caution.

Note 2: While this command does not permanently store your password on the local computer, it will be stored in the do file. I highly recommend creating a separate gmail account for this purpose.

Note 3: Text addresses are carrier-specific. Some examples:

Carrier Email to SMS Gateway

Alltel 1234567890@message.alltel.com

AT&T 1234567890@txt.att.net

Boost Mobile 1234567890@myboostmobile.com

Nextel 1234567890@messaging.nextel.com

Sprint PCS 1234567890@messaging.sprintpcs.com

T-Mobile 1234567890@tmomail.net

US Cellular 1234567890@email.uscc.net

Verizon 1234567890@vtext.com

Virgin Mobile 1234567890@vmobl.com

Examples

standard

emailme example@gmail.com, username(testemail) password(password1) from(testemail@gmail.com) subject(emailme example) body(emailme example)

abbreviated option names

emailme example@gmail.com, u(testemail) p(password1) f(testemail@gmail.com) s(emailme example) b(emailme example)

email and text (or secondary email)

emailme example@gmail.com, u(testemail) p(password1) f(testemail@gmail.com) s(emailme example) b(emailme example) alt(1234567890@vtext.com)

Author

Ed Gerrish

School of Public and Environmental Affairs

Indiana University

egerrish@indiana.edu

egerrish@gmail.com