【发布时间】:2021-10-09 14:36:07
【问题描述】:
我一直在设置mailR包从我的Outlook帐户发送电子邮件,但到目前为止我一直无法使其顺利工作,我得到结果有时发送电子邮件成功有时失败。
代码如下(为了隐私/安全,将电子邮件和密码替换为“aaa”和“bbb”):
send.mail(from = "aaa@domain.com",
to = "bbb@domain.com",
subject = subject,
body = 'Test Successful',
encoding = 'utf-8',
html = TRUE,
inline = TRUE,
attach.files = filenamex,
smtp = list(host.name = 'smtp.office365.com',
port = 587,
user.name="aaa@domain.com",
passwd= "abc",
tls = TRUE
),
authenticate = TRUE,
send = TRUE)
当我每隔 5 分钟运行一次代码时,我得到以下结果
2. send email at 2021-10-04 20:55:01 +07 failed !
1. send email at 2021-10-04 21:00:01 +07 successful !
2. send email at 2021-10-04 21:05:01 +07 failed !
2. send email at 2021-10-04 21:10:02 +07 failed !
2. send email at 2021-10-04 21:15:01 +07 failed !
1. send email at 2021-10-04 23:03:09 +07 successful !
2. send email at 2021-10-04 23:05:01 +07 failed !
1. send email at 2021-10-04 23:10:01 +07 successful !
2. send email at 2021-10-04 23:15:01 +07 failed !
1. send email at 2021-10-04 23:20:01 +07 successful !
1. send email at 2021-10-04 23:25:01 +07 successful !
1. send email at 2021-10-04 23:30:02 +07 successful !
知道出了什么问题吗?
【问题讨论】: