发送邮件提交asp.net mvc

时间:2017-04-06 13:00:25

标签: c# asp.net asp.net-mvc

我必须在表格提交上发送邮件,但它不能与我合作

            // envoyer mail
            SmtpClient client = new SmtpClient("host");
            //User name and password goes here 


            MailMessage mailMessage = new MailMessage { From = new MailAddress("someone@somewhere.com") };
            mailMessage.To.Add("someone@somewhere.com");
            mailMessage.Subject = "Hello There";
            mailMessage.Body = "Hello my friend!";

            client.Host = "host";
            client.Port = 25;
            User name and password
            client.EnableSsl = false;
            client.Send(mailMessage);

谢谢

0 个答案:

没有答案