本文介绍了通过asp.net发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我想通过邮件向管理员发送请求。当管理员接受该请求时,如何更新我的数据库是否被批准。



你能帮我吗。



谢谢和问候。



Narasimha Rao

Hello There,

I want to send a request to the admin through mail. When the admin is accept that request then how to update my database whether it is approved or not.

Can you pls help me.

Thanks & Regards.,

Narasimha Rao

推荐答案

var smtp = new System.Net.Mail.SmtpClient();
    {
        smtp.Host = "smtp.gmail.com";
        smtp.Port = 587;
        smtp.EnableSsl = true;
        smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
        smtp.Credentials = new NetworkCredential(fromAddress, fromPassword);
        smtp.Timeout = 20000;
    }
    // Passing values to smtp object
    smtp.Send(fromAddress, toAddress, subject, body);



Quote:

SmtpClient SmtpServer = new SmtpClient();

SmtpServer.Credentials = new Net.NetworkCredential([email protected],密码);

SmtpServer.Port = 587;

SmtpServer.Host =smtp.gmail.com;

SmtpS erver.EnableSsl = true;



mail = new MailMessage();

mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;

mail.ReplyTo = new MailAddress(TextBox1.Text);

SmtpServer.Send(mail);

SmtpClient SmtpServer = new SmtpClient();
SmtpServer.Credentials = new Net.NetworkCredential("[email protected]", "password");
SmtpServer.Port = 587;
SmtpServer.Host = "smtp.gmail.com";
SmtpServer.EnableSsl = true;

mail = new MailMessage();
mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure;
mail.ReplyTo = new MailAddress(TextBox1.Text);
SmtpServer.Send(mail);


这篇关于通过asp.net发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 00:29