Hi,
I am trying to send an email through gmail or outlook from my Windows PC and finding trouble to send the email. The code which I am using is given below: Code : library("sendmailR") from <- "a...@outlook.com" to <- <mailto:e...@gmail.com> e...@gmail.com subject <- "Run at" mailControl = list(smtpServer="blu-m.hotmail.com") attachment <- "type_1.pdf" attachmentName <- "target_score.pdf" attachmentObject <- mime_part(x= attachment,name= attachmentName) body <- "Email Body" bodywithAttachement <- list(body, attachmentObject) sendmail(from=from,to=to,subject=subject,msg= bodywithAttachement,control=mailControl) However it gives me following Error: 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) : blu-m.hotmail.com:25 cannot be opened I have also tried the other library i.e. mail but it does not support attaching the object. And also tried it with following command which was also unfruitful with password given. Code : sendmail(from=" e...@gmail.com <mailto:e...@gmail.com> ", to=" e...@gmail.com <mailto:e...@gmail.com%22,%20text=%22Send> ", text="Send Email", subject="MAil", smtp="smtp.gmail.com", user= "e...@gmail.com", pw="pwd") 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) : localhost:25 cannot be opened Please let me know if we have some solution for this. Best Regards, Bhupendrasinh Thakre [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.