我已经创建了以下代码来发送一封带有UTF-8格式的发件人地址的电子邮件。我知道msmtp支持IDN,但是当我运行这个程序时,我得到一个错误信息,字符\xe2\x82\xac (也就是‘error’)是无效的。
msmtp: envelope from address relu\u20ac@4p\u20ac.com not accepted by the server
msmtp: server message: 555 5.5.2 Syntax error. p83sm6227819wma.18 - gsmtp
msmtp: could not send mail (account default from /usr/local/etc/msmtprc)代码如下:
#include <stdio.h>
int main(){
char* sender = "relu\xe2\x82\xac@4p\xe2\x82\xac.com";
char cmd[100];
sprintf(cmd, "echo \"bla\" | msmtp -f %s example@domain.com", sender);
system(cmd);
return 0;
}https://stackoverflow.com/questions/38398950
复制相似问题