如何使用C#中的接受或拒绝按钮发送自动生成的邮件 [英] how to send autogenerated mail with accept or reject button in c#

查看:100
本文介绍了如何使用C#中的接受或拒绝按钮发送自动生成的邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在c#

推荐答案


中使用接受"或拒绝"按钮发送自动生成的邮件
希望对您有帮助.
Hi,

I hope that this helps you.
MailMessage MailMesaji = new MailMessage();
MailMesaji.Subject = "Hello";
MailMesaji.Body = " How are u";
MailMesaji.BodyEncoding = Encoding.GetEncoding("Windows-1254");
MailMesaji.From = new MailAddress("Email Sender @ Domain");
MailMesaji.To.Add(new MailAddress("Email Reciever @ Domain"));
SmtpClient Smtp = new SmtpClient("smtp.mail.yahoo.com");
OpenFileDialog Ofd = new OpenFileDialog();
if (Ofd.ShowDialog() == DialogResult.OK)
{
    string Att = Ofd.FileName;
    Attachment ATTa = new Attachment(Att);
    MailMesaji.Attachments.Add(ATTa);

}

Smtp.Credentials = new System.Net.NetworkCredential("Email Sender @ Domain", "");
Smtp.Send(MailMesaji);
MessageBox.Show("mail Send");


如果您想对邮件采取任何措施,则必须通过我们的代码发送一个链接,该链接将重定向到您的网站.仅当用户单击页面中的"Accept""Reject"时,您才需要编写代码.通过邮件,您只能发送参数实际要执行的操作,即"Accept""Reject".

例如

If you want any action in your mail than you have to send a link through our code which redirect in to your website. You have to do code what you want to do when user click on "Accept" or "Reject" in your page only. Through mail you can only send the parameters what actually you want to do either it is "Accept" or "Reject".

for example

<a href="http://www.yourwebsitename.com?att=acpt">Accept</a>


<a href="http://www.yourwebsitename.com?att=reject">Reject</a>


注意:如果您发送加密的查询字符串,那将非常有用,这样用户就无法更改任何内容.

这是我给您的最简单的解决方案.如果您想要按钮,则必须通过
发送页面
action 用于


Note: It will be great if you send encrypted querystring, so that the user can''t change anything.

This is the simplest solution i had given you. If you want button than you have to send your page through

action used in

<form>



谢谢
灰烬



Thanks
Ashish


这篇关于如何使用C#中的接受或拒绝按钮发送自动生成的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆