I have a RShiny App that I made for my client. There is a feature in the app where a user clicks the button and it sends a test email to the user. I am using sendmailR library. This feature works fine on my local system but when I deploy the app on the AWS Server, I get an error saying:
Warning: Error in socketConnection: cannot open the connection
Warning in socketConnection(host = server, port = port, blocking = TRUE)
HIDDENSERVERNAME:25 cannot be opened
Please note that on AWS, for the App security group, the port range is set to All, Type is set to All Traffic, and Protocol is set to All. So, the AWS firewall settings are not blocking the port 25. Here is the code:
library(sendmailR)
host = HIDDEN
port = 25
from = 'noreply@companydomain.com'
to = 'yyy@companydomain.com'
subject = 'Test Email'
body = 'This is a test email'
sendmail(
from, to, subject,
msg = body,
control = list(
verboseShow = TRUE,
smptpServer = host,
smtpPort = port
)
)