I have trouble sending email with the packages sendmailR
via Outlook.
It work fine on my main computer (windows machine) but when I try it on my virtual machine running with Ubuntu I get the following error:
Error in socketConnection(host = server, port = port, blocking = TRUE) :
cannot open the connection
In addition: Warning message:
In socketConnection(host = server, port = port, blocking = TRUE) :
MYADRESSE.local:25 cannot be opened
I used the following code that once again work fine on the host machine.
library(sendmailR)
from <- "myname@company.com"
to <- "myname@company.com"
subject <- "Performance Result"
body <- "This is the result of the test:"
mailControl=list(smtpServer="MYADRESSE.local")
sendmail(from=from,to=to,subject=subject,msg=body,control=mailControl)
Do I have to set up the virtual machine to access MYADRESSE.local
? The network between the two (host and hosted) is set up to "bridge". My final goal would be to use shiny server to creat an app able to send emails through the main Outlook of the host, that for the moment, emails put aside work perfectly.
Outlook is mail client, so does sendmailR . I assume you mean, you send mail through your SMTP mail server that your outlook mail client also connect to.
First, check whether you can ping your SMTP mail server from virtual machine. The same SMTP mail server as your outlook.
Second, try telnet from VM ubuntu to your SMTP server e.g.
telnet your-smtp-server 22
If neither works, look for those question about connecting VM to your LAN.
(UPDATE) For your Windows machine to talk to MYADRESSE.local , there must be a setting in the host file. Go open c:\windows\system32\drivers\etc\hosts, and see whether there is a entry for it. If the entry show
127.0.0.1 MYADRESSE.local
This mean you have a SMTP server setting in your windows system. If any other address, e.g. (just example, the address can be varied)
192.168.100.10 MYADDRESS.local
Then 192.168.100.10 is your SMTP server addresss . Then the ping , telnet work show above should use this IP address. e.g. telnet 192.168.100.10... And your SendMailR should use this IP address, not MYADDRESS.local