# NOT RUN {
library(magrittr)
# Set parameters for SMTP server (with username and password)
smtp <- server(host = "smtp.gmail.com",
port = 465,
username = "bob@gmail.com",
password = "bd40ef6d4a9413de9c1318a65cbae5d7")
# Set parameters for a (fake) testing SMTP server.
#
# More information about this service can be found at https://www.smtpbucket.com/.
#
smtp <- server(host = "mail.smtpbucket.com",
port = 8025)
# Create a message
msg <- envelope() %>%
from("bob@gmail.com") %>%
to("alice@yahoo.com")
# Send message (verbose output from interactions with server)
# }
# NOT RUN {
smtp(msg, verbose = TRUE)
# }
# NOT RUN {
# To confirm that the message was sent, go to https://www.smtpbucket.com/ then:
#
# - fill in "bob@gmail.com" for the Sender field and
# - fill in "alice@yahoo.com" for the Recipient field then
# - press the Search button.
# }
Run the code above in your browser using DataLab