I have created the following code to send an email with from address set with UTF-8 format. I know that msmtp has IDN support, but when i run this program, i get an error message that character \xe2\x82\xac
(aka '€') is invalid.
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)
This is the code:
#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;
}