有没有办法通过点击按钮从Spotfire发送电子邮件?

时间:2017-06-07 17:20:23

标签: javascript r email ironpython spotfire

我正在寻找一个选项,使用iron python

在点火文本区域点击按钮发送电子邮件

(或)

我们可以在iron python和Automation Services的帮助下实现它。

(或)

有没有办法使用R编程完成它

import clr
clr.AddReference("Microsoft.Office.Interop.Outlook")
from System.Runtime.InteropServices import Marshal


mail= Marshal.GetActiveObject("Outlook.Application").CreateItem(0)
mail.Recipients.Add("abc@xyz.com")
mail.Subject = "subject here"
mail.Body = "Body here"
mail.Send();

以上代码是发送电子邮件,它在spotfire客户端工作正常但不在网络播放器中。请帮助我

1 个答案:

答案 0 :(得分:0)

您可以使用mailR包触发电子邮件。这对我有用 -

sender <- "sender@gmail.com" 
recipient<- "receiver1@gmail.com" 
email <- send.mail(from = sender,to = recipients,subject="R-email",body = 
"Body of the email",smtp = list(host.name = "smtp.gmail.com", 
user.name="myuser@gmail.com",passwd="password",port=587,ssl=TRUE),authenticate 
= TRUE,send = FALSE)
email$send() 
相关问题