验证电子邮件中的文本框 [英] Validating Textbox inside the email

查看:83
本文介绍了验证电子邮件中的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在创建一个发送邮件的应用程序,我已经制作了邮件格式。我有文本框和链接。我需要验证文本框,它在点击likn时包含一些值。



我被困在两点



1.我在邮件中添加了一个TextBox。文本框适用于浏览器,但对于Outlook它不能正常运行



2.我需要验证它在用户单击超链接时应该包含一些数据



提前感谢



谢谢和问候



VRN



代码片段

Hi,

I m creating an application that sends the mail, i have made a mail format. I have textbox and a link. I need to validate the textbox that it contains some value on click of the likn.

im stuck at two points

1.I have added a TextBox in the mail. The textbox is coming properly for Browser but for Outlook it is not working

2. I need to validate it that it should contain some data when the user clicks the hyper link

thanks in advance

thanks and regards

VRN

Code Snippet

System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
            mail.To.Add("varun.adaptive@gmail.com");
            mail.From = new MailAddress("info.adaptiveprocesses@gmail.com", "Email head", System.Text.Encoding.UTF8);
            mail.Subject = "This mail is send from asp.net application";
            mail.SubjectEncoding = System.Text.Encoding.UTF8;
            mail.Body = "<input type=\"text\" style=\"width:130px\" id=\"txtRemarks\" name=\"txtRemarks\" runat=\"server\" />Please <a href=\"" + ConfigurationManager.AppSettings["Link"].ToString() + "/\"><button type=\"button\">Click</button></a>";
            
            mail.BodyEncoding = System.Text.Encoding.UTF8;
            mail.IsBodyHtml = true;
            mail.Priority = MailPriority.High;
            SmtpClient client = new SmtpClient();
            client.Credentials = new System.Net.NetworkCredential("Email", "Password");
            client.Port = 587;
            client.Host = "smtp.gmail.com";
            client.EnableSsl = true;
            try
            {
                client.Send(mail);
                Page.RegisterStartupScript("UserMsg", "<script>alert('Successfully Send...');</script>");
            }

推荐答案

不能工作 - 更好的方法是让超链接带你到一个填写的页面一些信息(来自超链接查询字符串)然后让用户在那里输入数据。试图在电子邮件正文中获取用户输入是非常不寻常的,并且

a)AFAIK无论如何都无法在Outlook中工作



b )我怀疑大多数人会被视为垃圾邮件/网络钓鱼活动。
Not going to work - the better approach is to have the hyperlink take you to a page which fills in some info (from the hyperlink query string) then get the user to enter data there. Trying to get user input in the body of an email is highly unusual, and
a) AFAIK won't work in Outlook anyway
And
b) Would be seen as spam / phishing activity by most people I suspect.


这是使用jquery验证插件验证电子邮件地址客户端的最佳方法。查看操作方法



http://jqueryvalidation.org/email-方法/ [ ^ ]
Here is the best way to validate an email address client side using jquery validation plugin. Check How-to here

http://jqueryvalidation.org/email-method/[^]

这篇关于验证电子邮件中的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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