Click here to Skip to main content
14,924,621 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Comments
yogiCsharp 18-Oct-11 1:52am
   
Put "Mail sending in ASP.net" as keyword in Google search bar, you will get numerous results related to this there's not any issue,
happy coding :)

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);
   
Hi,

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900