sendmail | R Documentation |
Send emails via command line tools.
sendmail(subject, body, body.file = NULL, to = NULL, from,
cc = NULL, bcc = NULL, replyto = NULL,
server, port, user, password,
attach = NULL, signature = NULL, signature.file = NULL,
headers = NULL, wait = TRUE, logfile = NULL,
encoding = "unknown", method = NULL,
display.only = FALSE, html = FALSE, tls = NULL,
SendUsingAccount)
subject |
character |
body |
character. When of length > 1, then all elements are pasted together, separated by newline characters |
body.file |
character. If specified, |
to |
character |
from |
character |
cc |
character |
bcc |
character |
replyto |
character |
server |
character |
port |
character (an integer will automatically be coerced). Typically 587. |
user |
character |
password |
character |
attach |
character |
signature |
character |
signature.file |
character. Name of file. |
headers |
a character vector of header lines (i.e. for more than one
header use |
wait |
logical |
logfile |
character |
encoding |
character |
method |
the programme to be called. Supported are sendemail, blat and outlook. Method outlook is supported only on Windows, where it also requires PowerShell. |
display.only |
logical: if |
html |
logical: send as HTML? For method |
tls |
|
SendUsingAccount |
a character string: an email address.
only supported for method ‘ |
The function provides a wrapper for different tools that send emails. In this way, the same R code that can be used across platforms, provided a suitable backend is installed.
The function constructs an invocation of a
command-line utility, specified by method
, and
then calls the specified method via
system
. Currently supported are sendemail
,
Blat
and Outlook
(see References).
the return value of system
Enrico Schumann
http://caspian.dotconf.net/menu/Software/SendEmail/ https://www.blat.net/
RFC 2822: Internet Message Format. https://tools.ietf.org/html/rfc2822
## Not run:
body <- "
<p>Hello.</p>
<p>Please do not send <b>spam</b></p>.
"
sendmail(subject = "Greetings",
body = "Hello",
to = "testing@testing.org",
method = "outlook",
html = TRUE,
display.only = TRUE) ## only open mail in Outlook
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.