【发布时间】:2017-12-30 00:24:03
【问题描述】:
我有一个用 c++ 构建的 smtp 客户端,我可以在其中向我的测试邮件陷阱帐户发送电子邮件。 标头已发送,电子邮件也正常到达。
我的问题是,指示从/到的字段是空的 - 如屏幕截图所示
我正在发送带有
的标题write_command("MAIL FROM: <foo@bar.de>");
write_command("RCPT TO: <foo@bar.de>");
我用我的 Smtp 客户端的完整代码做了一个要点
https://gist.github.com/anonymous/7bb13de7f044bcb5d07d0e6a9d991ea9
我从我的 main() 函数调用它
与
Smtp smtp_client = Smtp();
smtp_client.new_connection("smtp.mailtrap.io", 25);
smtp_client.auth_login("username", "password");
smtp_client.sendmail();
smtp_client.close_connection();
感谢您的关注
【问题讨论】:
-
我想我做到了。我编辑了答案。
标签: c++ email smtp smtpclient