1

I am looking for a better solution to something I am currently doing. We send out hundreds of emails a day using a combination of Windows Task Scheduler and r-scripts and the mailr package. Some issues we are running in to with this is if we try to send to many emails at once, our Microsoft Exchange Server cannot handle it and it errors out the r-script. Does anyone out there also encounter this problem, or does anyone have any better solutions? These emails that we send out are business critical so we still need to send them, but I am looking for a way to do this with some relief to our Exchange Server. Can RStudio Connect do this?

Andrew P
  • 11
  • 2
  • 1
    You could add `sys.sleep(2)` into your script at the end of an iteration in a loop which reads the email addresses, creates the email and send it. This would make the system wait 2-seconds between sends. Obviously that is likely overkill..but you can use decimal seconds too to get to a rate that does not get flagged by your system. – sconfluentus Jan 12 '20 at 01:37
  • Thank you for the comment. I have already worked that into my scripts, but the issues come when there are multiple scripts sending out emails around the same time. We have several instances where different people need different reports at the same time, and all the emails are coming from the same email address. – Andrew P Jan 13 '20 at 16:36
  • I use automated messaging to send updates to myself and other team-members if there is a problem with one of our systems, we ended up using multiple email accounts to avoid our provider thinking that they were malicious or hijacked. Another think you can due is pay for an smtp server of your own and not be limited by MS relay. – sconfluentus Jan 13 '20 at 16:59
  • and Rstudio connect can automate things, but it would still require your outgoing mail server to push emails, so it would not eliminate the problem. More likely an email server of your own, not MS would be as affordable as connect and a much better solution to the problem. – sconfluentus Jan 13 '20 at 17:01

0 Answers0