联系表格的邮件发送代码 [英] MAIL SENDING CODE FOR CONTACT FORM

查看:76
本文介绍了联系表格的邮件发送代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个联系表格,其中包括姓名,电子邮件,电话号码,项目名称,查询详细信息.在联系表单中,单击提交"按钮时,必须将用户输入的所有详细信息邮寄到公司邮件ID.

i want to create a contact form,the fields included in it are name,email,phone number,project name,enquiry details.In the contact form when clicking on the submit button,all the details user entered must be mailed to the company mail id.

推荐答案

string s=//Put the values of textboxes here
MailMessage m = new MailMessage("mailidofSender", To);
            m.Subject = Subject;
            m.Body = s;
            m.IsBodyHtml = true;
            SmtpClient smtp = new SmtpClient();
            smtp.Host = "mail.google.com";
            NetworkCredential authinfo = new NetworkCredential("mailidfrom", "YourPassword");
            smtp.UseDefaultCredentials = false;
            smtp.Credentials = authinfo;
            smtp.Send(m);




请参阅此代码项目链接
在ASP.Net 2.0中发送电子邮件-反馈表 [
Hi,

Refer this codeproject link
Send Email in ASP.Net 2.0 - Feed back Form[^]


这篇关于联系表格的邮件发送代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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