NNSMTP发送mail时,内容中文乱码问题
NMSMTP1-> PostMessage-> Body-> Text= "测试 ";
NMSMTP1-> PostMessage-> Subject= "测试 ";
NMSMTP1-> PostMessage-> LocalProgram= "SendMail() ";
NMSMTP1-> SendMail();
NMSMTP1-> Disconnect();
如上面代码,标题是可以显示中文的,但内容都显示乱码.
希望高手帮忙
[解决办法]
NMSMTP1->Host = "88mail.ysu.edu.cn"; //SMTP主机名
NMSMTP1->UserID = "qc"; //用户名
NMSMTP1->PostMessageA->FromAddress = "qc@88mail.ysu.edu.cn"; //发信人地址
NMSMTP1->PostMessageA->ToAddress->Clear(); //收信人地址清空
NMSMTP1->PostMessageA->ToAddress->Text = "feixiangys@gmail.com"; //收信人地址
NMSMTP1->TimeOut = 10000;
NMSMTP1->ClearParams = true;
NMSMTP1->EncodeType = uuMime;
NMSMTP1->Charset = "gb2312"; //后加部分。
NMSMTP1->FinalHeader->
NMSMTP1->TimeOut = 10000;
NMSMTP1->SubType = mtPlain;
NMSMTP1->EncodeType = uuMime;
NMSMTP1->PostMessageA->LocalProgram = "SendMail";
NMSMTP1->PostMessageA->Subject = "测试"; //邮件标题
NMSMTP1->PostMessageA->Body->Add("测试附件为图片的形式"); //邮件内容
NMSMTP1->PostMessage->Attachments->Text = ComboBoxAttach->Items->Text;