rpremraj / mailR

A utility to send emails from the R programming environment
http://rpremraj.github.io/mailR/
190 stars 57 forks source link

how to set recipientsDisplayName #72

Closed zhouq1986 closed 6 years ago

zhouq1986 commented 6 years ago

I use mailR to send Email, code like this: send.mail(
from = "dsdsjzx@thfund.com.cn" ,
to = "zhouq@thfund.com.cn",
subject = "this is title" ,
body = body,
encoding = "utf-8",
html = TRUE,
smtp = list(
host.name = "mailtj.thfund.com.cn",
port = 25,
user.name = "dsdsjzx@thfund.com.cn" ,
passwd = "****" ),
authenticate = FALSE,
send = TRUE
)
but I want to set recipientsDisplayName , like "电商大数据中心" In C#, the have recipientsDisplayName . like ### string recipientsDisplayName = "张三";//这个配置的是收件人的要显示在邮件的名称
MailAddress mailfrom = new MailAddress(from, senderDisplayName, encoding);//发件人邮箱地址,名称,编码UTF8

how to use mailR to do this?

rpremraj commented 6 years ago

You can accomplish this presented in the first example in the Readme file:

send.mail(from = "Sender Name <sender@gmail.com>",
          to = c("Recipient Name 1 <recipient1@gmail.com>", "Recipience Name 2 <recipient2@gmail.com>"),
          subject = "Subject of the email",
          body = "Body of the email",
          smtp = list(host.name = "aspmx.l.google.com", port = 25),
          authenticate = FALSE,
          send = TRUE)