VMime 是一个开源的用于处理电子邮件的 C++ 类库,支持 IMAP, POP 和 SMTP.
示例代码:
vmime::utility::url url(” smtp ://smtp.gmail.com”); vmime::ref tr = session->getTransport(url); tr- >setProperty(“connection.tls”, true); tr->setProperty(“auth.username”, “gmail-login”); tr->setProperty(“auth.password”, “gmail-password”); tr->setProperty(“options.need-authentication”, true); tr->setCertificateVerifier(yourCertificateVerifier);