public void TestSmtpServerByQQ() { var settings = ConfigurationManager.AppSettings; MessageObject message = SmtpClientTester.Test("smtp.qq.com", "25", "ON", "*****@*****.**", settings["qq_mail_password"], "*****@*****.**", "*****@*****.**"); Assert.AreEqual(message.ReturnCode, "0"); }
public void TestSmtpServerByExmail() { var settings = ConfigurationManager.AppSettings; MessageObject message = SmtpClientTester.Test("smtp.exmail.qq.com", "25", "ON", "*****@*****.**", settings["exmail_mail_passwoed"], "*****@*****.**", "*****@*****.**"); Assert.AreEqual(message.ReturnCode, "0"); }
public void TestSmtpServerByGmail() { var settings = ConfigurationManager.AppSettings; MessageObject message = SmtpClientTester.Test("smtp.gmail.com", "465", "ON", settings["gmail_mail_username"], settings["gmail_mail_password"], settings["gmail_mail_from"], settings["gmail_mail_to"]); Assert.AreEqual(message.ReturnCode, "0"); }
/// <summary></summary> /// <param name="doc">Xml 文档对象</param> /// <returns>返回操作结果</returns> public string TestSmtpServer(XmlDocument doc) { string host = XmlHelper.Fetch("host", doc); string port = XmlHelper.Fetch("port", doc); string enableSsl = XmlHelper.Fetch("enableSsl", doc); string username = XmlHelper.Fetch("username", doc); string password = XmlHelper.Fetch("password", doc); string fromEmailAddress = XmlHelper.Fetch("fromEmailAddress", doc); string toEmailAddress = XmlHelper.Fetch("toEmailAddress", doc); MessageObject message = SmtpClientTester.Test(host, port, enableSsl, username, password, fromEmailAddress, toEmailAddress); return("{\"message\":" + message + "}"); }