# Set parameters for SMTP server (with username and password).
smtp <- server(
host = "smtp.gmail.com",
port = 587,
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)
if (FALSE) {
smtp(msg, verbose = TRUE)
}
# 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.
# With explicit HELO domain.
#
smtp <- server(
host = "mail.example.com",
helo = "client.example.com"
)
# Set parameters for Gmail SMTP server. The host and port are implicit.
smtp <- gmail(
username = "bob@gmail.com",
password = "bd40ef6d4a9413de9c1318a65cbae5d7"
)
# Set API key for SendGrid SMTP server.
smtp <- sendgrid(
password = "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"
)
# Set username and password for Mailgun SMTP server.
smtp <- mailgun(
username = "postmaster@sandbox9ptce35fdf0b31338dec4284eb7aaa59.mailgun.org",
password = "44d072e7g2b5f3bf23b2b642da0fe3a7-2ac825a1-a5be680a"
)
# Set username and password for Sendinblue SMTP server.
smtp <- sendinblue(
username = "bob@gmail.com",
password = "xsmtpsib-c75cf91323adc53a1747c005447cbc9a893c35888635bb7bef1a624bf773da33"
)
# Set username and password for MailerSend SMTP server.
smtp <- mailersend(
username = "NS_Pf3ALM@gmail.com",
password = "e5ATWLlTnWWDaKeE"
)
# Set username and password for Mailfence SMTP server.
smtp <- mailfence(
username = "bob",
password = "F!Uosd6xbhSjd%63"
)
# Set password for ZeptoMail SMTP server.
# nolint start
smtp <- zeptomail("yA6KbHsL4l2mmI8Ns0/fs9iSTj8yG0dYBgfIG0j6Fsv4P2uV32xh8ciEYNYlRkgCC7wRfkgWA==")
# nolint end
# SMTP Bucket server.
smtp <- smtpbucket()
# SMTP Bucket server.
smtp <- smtpbucket()
Run the code above in your browser using DataLab