ASP.NET send mail through gmail
-
I use the follwing code in ASP.NET 2008 its working well but not working in 2005 String server = "smtp.gmail.com"; SmtpClient SmtpServer = new SmtpClient(); SmtpServer.Credentials = new System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text); SmtpServer.Port = 587; SmtpServer.Host = server; SmtpServer.EnableSsl = true; MailMessage mail; mail = new MailMessage(); mail.From = new MailAddress(TextBox2.Text, TextBox1.Text, System.Text.Encoding.UTF8); mail.To.Add("skbataan@gmail.com"); mail.Subject = "FeedBack"; mail.Body = TextBox4.Text; mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; SmtpServer.Send(mail); Any Solution
Amit Battan Ror battan20@gmail.com
-
I use the follwing code in ASP.NET 2008 its working well but not working in 2005 String server = "smtp.gmail.com"; SmtpClient SmtpServer = new SmtpClient(); SmtpServer.Credentials = new System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text); SmtpServer.Port = 587; SmtpServer.Host = server; SmtpServer.EnableSsl = true; MailMessage mail; mail = new MailMessage(); mail.From = new MailAddress(TextBox2.Text, TextBox1.Text, System.Text.Encoding.UTF8); mail.To.Add("skbataan@gmail.com"); mail.Subject = "FeedBack"; mail.Body = TextBox4.Text; mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; SmtpServer.Send(mail); Any Solution
Amit Battan Ror battan20@gmail.com
-
I use the follwing code in ASP.NET 2008 its working well but not working in 2005 String server = "smtp.gmail.com"; SmtpClient SmtpServer = new SmtpClient(); SmtpServer.Credentials = new System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text); SmtpServer.Port = 587; SmtpServer.Host = server; SmtpServer.EnableSsl = true; MailMessage mail; mail = new MailMessage(); mail.From = new MailAddress(TextBox2.Text, TextBox1.Text, System.Text.Encoding.UTF8); mail.To.Add("skbataan@gmail.com"); mail.Subject = "FeedBack"; mail.Body = TextBox4.Text; mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; SmtpServer.Send(mail); Any Solution
Amit Battan Ror battan20@gmail.com
Amit Battan Ror wrote:
but not working in 2005
As led mike said, what do you mean by "not working"? Be more clear and someone may help you out.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
-
I use the follwing code in ASP.NET 2008 its working well but not working in 2005 String server = "smtp.gmail.com"; SmtpClient SmtpServer = new SmtpClient(); SmtpServer.Credentials = new System.Net.NetworkCredential(TextBox2.Text, TextBox3.Text); SmtpServer.Port = 587; SmtpServer.Host = server; SmtpServer.EnableSsl = true; MailMessage mail; mail = new MailMessage(); mail.From = new MailAddress(TextBox2.Text, TextBox1.Text, System.Text.Encoding.UTF8); mail.To.Add("skbataan@gmail.com"); mail.Subject = "FeedBack"; mail.Body = TextBox4.Text; mail.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; SmtpServer.Send(mail); Any Solution
Amit Battan Ror battan20@gmail.com
Why on earth does your code have Textbox1 and Textbox2 ? How is that readable ?
Christian Graus Driven to the arms of OSX by Vista.