void WsNewsLetter::sendMail(const Mail::Message& message) const { Mail::Message m = message; if (m.from().empty()) { std::string senderName = "Ws letter module"; std::string senderAddress = "*****@*****.**"; m.setFrom(Mail::Mailbox(senderAddress, WString::fromUTF8(senderName))); } m.write(std::cout); Mail::Client client; client.connect(); client.send(m); }
void AuthService::sendMail(const Mail::Message& message) const { Mail::Message m = message; if (m.from().empty()) { std::string senderName = "Wt Auth module"; std::string senderAddress = "*****@*****.**"; WApplication::readConfigurationProperty("auth-mail-sender-name", senderName); WApplication::readConfigurationProperty("auth-mail-sender-address", senderAddress); m.setFrom(Mail::Mailbox(senderAddress, WString::fromUTF8(senderName))); } m.write(std::cout); Mail::Client client; client.connect(); client.send(m); }