Older/UnitTest/MailTest.cpp

25 lines
885 B
C++
Raw Normal View History

2024-12-24 23:46:20 +08:00
#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;
2024-12-25 22:07:00 +08:00
// client.enableAuthentication("168062547@qq.com", "yourpassword", Wt::Mail::AuthenticationMethod::Login);
2024-12-24 23:46:20 +08:00
// client.setTransportEncryption(Wt::Mail::TransportEncryption::TLS);
2024-12-25 22:07:00 +08:00
// LOG(info) << client.connect("smtp.qq.com", 465);
2024-12-24 23:46:20 +08:00
2024-12-25 22:07:00 +08:00
// Wt::Mail::Mailbox from("168062547@qq.com");
2024-12-24 23:46:20 +08:00
2024-12-25 22:07:00 +08:00
// Wt::Mail::Mailbox to("amass.law1996@gmail.com");
2024-12-24 23:46:20 +08:00
// 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);
// }