Skip to content

Instantly share code, notes, and snippets.

@tukachev
Created September 30, 2021 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tukachev/682bb212e1423fe41306e743eac67b68 to your computer and use it in GitHub Desktop.
Save tukachev/682bb212e1423fe41306e743eac67b68 to your computer and use it in GitHub Desktop.
emal2sms
gmail.send <- function(username, password, emailto, sub, msg)
{
frommailuser <- paste(username,"@gmail.com", sep='')
com1 <- paste("sendEmail -f", frommailuser, "-t", emailto, "-o message-charset=utf-8 -u")
com2 <- "-m "
com3 <- paste("-o message-format=text -s smtp.gmail.com -o tls=yes -xu", username, "-xp", password)
system(paste(com1, sub, com2, msg, com3))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment