.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Code Snippets >> ASP.NET Controls >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Simple Contactus page in ASP.NET

Posted By:Athira Sreejith       Posted Date: December 31, 2008    Points: 10    Category: ASP.NET Controls    URL: http://www.dotnetspark.com  

Simple Contactus page in ASP.NET

.aspx page

Contact Us Form

Name :
Email Address :
Subject :
Body :
Verification Image :


Random Random = new Random();
int Number = Rand.Next(10000, 99999);
Bitmap Bitmap= new Bitmap(90, 50);
Graphics graphics= Graphics.FromImage(Bitmap);
Font Fnt = new Font("Verdana", 12, FontStyle.Bold);
graphics.DrawString(iNum.ToString(), Fnt, Brushes.Yellow, 15, 15);
int Y1 = Random.Next(0, 50);
int Y2 = Random.Next(0, 50);
graphics.DrawLine(Pens.Yellow, 0, Y1, 90, Y2);
Y1 = Random.Next(0, 50);
Y2 = Random.Next(0, 50);
graphics.DrawLine(Pens.Yellow, 0, Y1, 90,Y2);
Bmp.Save(Response.OutputStream, ImageFormat.Gif);
Session["Number"] = Number;


if (Session["Number"].ToString().Trim() == txtNumber.Text)
MailMessage m = new MailMessage(txtEmail.Text, ConfigurationManager.AppSettings["Email"].Trim());
m.Subject = txtSubject.Text;
m.Body = txtBody.Text;
SmtpClient o = new SmtpClient("mail.source.com");
Response.Write("Email has been sent successfully");
Response.Write("Verification Email not match. Please re-enter");


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend