[未知用户]
一个测试成功的例子:
library(mailR)
send.mail(
from = 'your email address',
to = 'your email address',
subject = 'this is test',
body = 'hello world',
encoding = 'utf-8',
html = TRUE,
smtp = list(
host.name = 'your email smtp host name',
port = 465,
user.name = 'your email address',
passwd = 'your password',
ssl = TRUE,
tls = TRUE),
authenticate = TRUE,
send = TRUE
)
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936
[2] LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mailR_0.4.1 sendmailR_1.2-1
loaded via a namespace (and not attached):
[1] base64enc_0.1-3 magrittr_1.5 R.methodsS3_1.7.1 R.oo_1.20.0
[5] R.utils_2.2.0 rJava_0.9-7 Rwordseg_0.2-1 stringi_1.0-1
[9] stringr_1.0.0 tools_3.1.2
ps:
复制的时候请注意,可能代码中的引号被论坛自动转义,所以请自行检查修正。我这个是在163的邮箱环境下测试成功,所以如果你打算复制这个例子,请自行注册一个163账号。关于163的smtp主机设置请参考:
http://help.163.com/09/1223/14/5R7P3QI100753VB8.html
:cool: