Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
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);
}