示例#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);
}
示例#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);
}
示例#3
0
文件: AuthService.C 项目: ansons/wt
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);
}