Beispiel #1
0
        public string sendEmail(string username, string password, string server, string port, string email, string subject, string content)
        {
            string result = "False";

            MailServer mailserver = new MailServer();
            mailserver.Username = username;
            mailserver.Password = password;
            mailserver.Server = server;
            mailserver.Port = int.Parse(port);

            result = mailserver.SendEmail(email, subject, content).ToString();

            return result;
        }
Beispiel #2
0
        public string sendEmail(string name, string email, string subject, string content)
        {
            string result = "False";

            if (User.Current != null && !string.IsNullOrEmpty(name))
            {
                MailServer mailserver = new MailServer();
                var item = mailserver.GetBy(name);
                if (item != null)
                {
                    mailserver.Username = item.Username;
                    mailserver.Password = item.Password;
                    mailserver.Server = item.Server;
                    mailserver.Port = item.Port;

                    result = mailserver.SendEmail(email, subject, content).ToString();
                }
            }
            return result;
        }