25 lines
885 B
C++
25 lines
885 B
C++
#include "BoostLog.h"
|
|
#include <Wt/Mail/Client.h>
|
|
#include <Wt/Mail/Mailbox.h>
|
|
#include <Wt/Mail/Message.h>
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
// BOOST_AUTO_TEST_CASE(MailTest) {
|
|
// Wt::Mail::Client client;
|
|
// client.enableAuthentication("168062547@qq.com", "yourpassword", Wt::Mail::AuthenticationMethod::Login);
|
|
// client.setTransportEncryption(Wt::Mail::TransportEncryption::TLS);
|
|
// LOG(info) << client.connect("smtp.qq.com", 465);
|
|
|
|
// Wt::Mail::Mailbox from("168062547@qq.com");
|
|
|
|
// Wt::Mail::Mailbox to("amass.law1996@gmail.com");
|
|
|
|
// Wt::Mail::Message message;
|
|
// message.setFrom(from);
|
|
// message.addRecipient(Wt::Mail:: RecipientType::To,to);
|
|
// message.setReplyTo(to);
|
|
// message.setSubject(Wt::WString::fromUTF8("Hey there, \xe2\x82\xac !"));
|
|
|
|
// message.setBody("你好");
|
|
// LOG(info) << client.send(message);
|
|
// }
|