| | |
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
- Need Web Based Contact Us Form (PHP)
- 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)
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 activexcontrol advice ajax alltypeofvideos appliances asp asp.net bc30451 beginner bottomasp.net box browser button c# c#gridviewcolumn cac checkbox click commonfunctions confirmationcodegeneration content courier css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dialog dropdownlist dynamically edit expose fileuploader fill flash formatdecimal forms formview gridview gudi homeedition iframe iis javascript jquery listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols radio redirect registration relationaldatabases reportemail rotatepage save schoolproject search security sessionvariables silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking treeview unauthorized validatedate validation vb.net video videos virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xml xsl youareanotmemberofthedebuggerusers





