Exemplo n.º 1
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);
#ifndef WT_TARGET_JAVA
        m.setFrom(Mail::Mailbox(senderAddress, WString::fromUTF8(senderName)));
#else
        m.setFrom(Mail::Mailbox(senderAddress, senderName));
#endif
    }

    m.write(std::cout);

    MailUtils::sendMail(m);
}
Exemplo n.º 2
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);
}
Exemplo n.º 3
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);
}