Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Email sendmailR:将编码邮件提交到本地SMTP服务器_Email_R_Encoding_Smtp - Fatal编程技术网

Email sendmailR:将编码邮件提交到本地SMTP服务器

Email sendmailR:将编码邮件提交到本地SMTP服务器,email,r,encoding,smtp,Email,R,Encoding,Smtp,我需要您的帮助,以便使用函数sendmail{sendmailR}从R中发送包含希腊文文本的电子邮件 我试着使用函数iconv,但没有成功 subject <- iconv("text in greek", to = "CP1253") sendmail(from, to, subject, msg, control=list(smtpServer="blabla")) subject如果没有Content-Type:charset=…,邮件客户端将无法理解任何编码,因此您必须添加它:

我需要您的帮助,以便使用函数sendmail{sendmailR}从R中发送包含希腊文文本的电子邮件

我试着使用函数
iconv
,但没有成功

subject <- iconv("text in greek", to = "CP1253")
sendmail(from, to, subject, msg, control=list(smtpServer="blabla"))

subject如果没有
Content-Type:charset=…
,邮件客户端将无法理解任何编码,因此您必须添加它:

msg<-iconv("text in greek", to = "utf8");
sendmail(from, to, subject, msg, 
control=list(smtpServer="blabla"),
headers=list("Content-Type"="text/plain; charset=UTF-8; format=flowed")
);

msg谢谢你。首先,如果有更好的方式发送邮件,我准备放弃sendmailR。“通过系统调用sendmail”是什么意思。请注意,我正在使用windows。对不起,我低估了这个软件包;试试这个。Windows。。。好的,这是个问题;仍然存在针对Windows的假sendmail。然而,最低级别的邮件发送方式是手动编写邮件(在邮件客户端中按
显示邮件源
或类似按钮可以查看电子邮件的真实外观),然后将其传送到sendmail。当然,如果Sendmairr失败,则后一种注释会出现;我刚刚测试了我的方法,它似乎有效。主要是通过阅读雷鸟制作的消息源;这仍然是MIME标准的一部分
msg<-iconv("text in greek", to = "CP1253");
sendmail(from, to, subject, msg, 
control=list(smtpServer="blabla"),
headers=list("Content-Type"="text/plain; charset=CP1253; format=flowed")
);