| | |
Contact form
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Dec 2008
Posts: 37
Reputation:
Solved Threads: 0
Hi, I'm trying to make a contact form, but it won't send the e-mail when I press send.
It doesn't make an error, just nothing happens.
I really don't know what the problem can be.
I'm doing it in .net c#
here is my code from my cs page:
Hope someone can see the problem and help me?
thanks
It doesn't make an error, just nothing happens.
I really don't know what the problem can be.
I'm doing it in .net c#
here is my code from my cs page:
ASP.NET Syntax (Toggle Plain Text)
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Data; using System.Configuration; using System.Collections; using System.Web.Security; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Net.Mail; public partial class dkkontakt : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void submit_click(object sender, EventArgs e) { MailMessage Emailmsg = new MailMessage("noreply@hotmail.com", "mymail@hotmail.com"); Emailmsg.Subject = "Kontaktform"; Emailmsg.Body += "E-mail" + email.Text; Emailmsg.Body += "Navn: " + name.Text; Emailmsg.Body += "Tekst: " + besked.Text; } }
Hope someone can see the problem and help me?
thanks
Hi try this
note that SmtpServer could be a real Smtp Server or 127.0.0.1 or "LocalHost"
hope that work
string email = "Your@email.com";
MailMessage message = new MailMessage();
message.From = new MailAddress(email);
message.To.Add("recipient@email.com");
message.Subject = "Subject";
message.Body = "Body";
SmtpClient emailClient = new SmtpClient("SmtpServer");
emailClient.Send(message);note that SmtpServer could be a real Smtp Server or 127.0.0.1 or "LocalHost"
hope that work
First try with your gmail id to send email. The below code will guide you how you can send email using your GMAIL ID. Modify your gmail credentials from the below code:
For further details you can read:
http://shawpnendu.blogspot.com/2009/...-aspnet-c.html
ASP.NET Syntax (Toggle Plain Text)
MailMessage mailMsg = new MailMessage(); // if you want to send HTML BODY then true for plain text body then false mailMsg.IsBodyHtml = true; mailMsg.Subject = "Asp.net articles"; mailMsg.Body = "<a href='http://shawpnendu.blogspot.com'>GO TO SHAWPNENDU'S BLOG</a>"; mailMsg.From = new MailAddress(shawpnendu@gmail.com); mailMsg.To.Add(mxxion@yahoo.com); SmtpClient smtp = new SmtpClient("smtp.gmail.com"); smtp.Credentials = new System.Net.NetworkCredential("shawpnendu@gmail.com", "password here"); // If you use your smtp server then try first with blocking the below line. smtp.EnableSsl = true; smtp.Send(mailMsg);
For further details you can read:
http://shawpnendu.blogspot.com/2009/...-aspnet-c.html
MARK AS SOLVED if its help you.
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
REGARDS
MCTS - Shawpnendu bikash maloroy
http://shawpnendu.blogspot.com
![]() |
Similar Threads
- Do you know any good contact form script (HTML and CSS)
- Contact form Flash/PHP sends with Text Formatting (PHP)
- PHP Contact form (PHP)
- Need a contact form (HTML and CSS)
- Need a contact form for my web site (Site Layout and Usability)
- Auto fill-in a field on the contact form (HTML and CSS)
- Contact form without scipts (PHP)
- Removing pictures from Outlook 2003 Contact form (Windows Software)
- Need Web Based Contact Us Form (PHP)
Other Threads in the ASP.NET Forum
- Previous Thread: how to edit detailsview
- Next Thread: Filter cascading dropdown lists
| Thread Tools | Search this Thread |
.net 2.0 3.5 ajax alltypeofvideos appliances asp asp.net beginner box browser businesslogiclayer button c# cac checkbox class commonfunctions compatible content contenttype control countryselector courier dataaccesslayer database datagrid datagridview datalist deployment development dgv dialog dropdownlist dropdownmenu dynamic dynamically edit embeddingactivexcontrol fileuploader fill findcontrol flash flv formview gridview gudi iis javascript list listbox login menu microsoft mouse mssql nameisnotdeclared news novell numerical opera order panelmasterpagebuttoncontrols problem radio ratings redirect registration relationaldatabases reportemail schoolproject search security serializesmo.table sessionvariables silverlight smoobjects software sql sql-server sqlserver2005 ssl tracking treeview validatedate validation vb.net videos vista visual-studio visualstudio vs2008 web webapplications webarchitecture webdevelopment webprogramming webservice wizard xsl





