Skip to content

Instantly share code, notes, and snippets.

@nmccready
Last active March 6, 2018 08:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nmccready/5217222 to your computer and use it in GitHub Desktop.
Save nmccready/5217222 to your computer and use it in GitHub Desktop.
Cool way to send email via Scala executing bash / shell.
import sys.process._
val body = "junk email body"
val subject = "test email subject"
val commaDelimitedEmails = "test1@gmail.com,test2@gmail.com"
//goal is to execute the same bash command without loading a file
//script would be identical to: echo body | mail -s subject addresses
Seq("echo", body) #| Seq("mail", "-s %s".format(subject), commaDelimitedEmails) !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment