我使用以下代码从vmime发送邮件:
vmime::string urlString;
urlString="smtp://outgoing.verizon.net";
vmime::utility::url url(urlString);
vmime::ref <vmime::net::transport> tr =
g_session->getTransport(url,vmime::create <interactiveAuthenticator>());
// You can also set some properties (see example7 to know the properties
// available for each service). For example, for SMTP:
tr->setProperty("options.need-authentication", true);
tr->setProperty("auth.username", userName);
tr->setProperty("auth.password", password);
fromString=userName+"@verizon.net";
vmime::mailbox from(fromString);
vmime::mailboxList to;
toString = toUserName+"@verizon.net";
to.appendMailbox(vmime::create <vmime::mailbox>(toString));
std::ostringstream data;
data<<subjectId;
// Connect to server
tr->connect();
// Send the message
vmime::string msgData = data.str();
vmime::utility::inputStreamStringAdapter vis(msgData);
tr->send(from, to, vis, msgData.length());
logMsg(DEBUG,2,"Thread Id: %ld,Sent the data in the transaction",pthread_self());我从日志中看到发送的数据是成功的。但是,当我连接到邮件发送到的邮箱并检查收件箱时,我看到该收件箱中没有邮件。vmime没有异常或错误。当我连接到网页版的邮件box.Iam无法看到任何事务是发送箱,即使是成功的mails.Can有人帮助我如何可以看到发送的邮件在发送箱?提前谢谢。
发布于 2013-01-22 18:54:10
使用任何嗅探器捕获来自主机的SMTP通信量。如果一切正常(例如SMTP会话正确),那么这不是主机的问题,而是远程MTA的问题(确保您的电子邮件未被检测为垃圾邮件等)
https://stackoverflow.com/questions/14456423
复制相似问题