How can i send email from my webform
-
my code is like this MailMessage mail=new MailMessage(); mail.To ="anu@gmail.com"; mail.From ="anu2@gmail.com"; mail.Subject = "Hai"; mail.Body = "your subject"; SmtpMail.Send(mail); it's executing.but i am not getting msg in my mail?what is the problem? When i am using this code Smtpmail.send(="anu@gmail.com","anu2@gmail.com","Hai","your subject") i am getting mail in anu2 can anyone tell what is the problem in above code? is there any thing i haveto set in webconfig file?Then How?....... Can anyone please help me?..it's urgent
-
my code is like this MailMessage mail=new MailMessage(); mail.To ="anu@gmail.com"; mail.From ="anu2@gmail.com"; mail.Subject = "Hai"; mail.Body = "your subject"; SmtpMail.Send(mail); it's executing.but i am not getting msg in my mail?what is the problem? When i am using this code Smtpmail.send(="anu@gmail.com","anu2@gmail.com","Hai","your subject") i am getting mail in anu2 can anyone tell what is the problem in above code? is there any thing i haveto set in webconfig file?Then How?....... Can anyone please help me?..it's urgent
Hi this is the method with arguments for send ============================================= public static void Send ( System.String from , System.String to , System.String subject , System.String messageText ) Member of System.Web.Mail.SmtpMail Summary: Sends an e-mail message using the specified destination parameters. Parameters: from: The address of the e-mail sender. to: The address of the e-mail recipient. subject: The subject line of the e-mail message. messageText: The body of the e-mail message. So its correct its sendting to anu2
Regards, Sylvester G sylvester_g_m@yahoo.com
-
Hi this is the method with arguments for send ============================================= public static void Send ( System.String from , System.String to , System.String subject , System.String messageText ) Member of System.Web.Mail.SmtpMail Summary: Sends an e-mail message using the specified destination parameters. Parameters: from: The address of the e-mail sender. to: The address of the e-mail recipient. subject: The subject line of the e-mail message. messageText: The body of the e-mail message. So its correct its sendting to anu2
Regards, Sylvester G sylvester_g_m@yahoo.com
-
my code is like this MailMessage mail=new MailMessage(); mail.To ="anu@gmail.com"; mail.From ="anu2@gmail.com"; mail.Subject = "Hai"; mail.Body = "your subject"; SmtpMail.Send(mail); it's executing.but i am not getting msg in my mail?what is the problem? When i am using this code Smtpmail.send(="anu@gmail.com","anu2@gmail.com","Hai","your subject") i am getting mail in anu2 can anyone tell what is the problem in above code? is there any thing i haveto set in webconfig file?Then How?....... Can anyone please help me?..it's urgent
Try This One it should work... System.Net.Mail.MailMessage mm = new System.Net.Mail.MailMessage(); mm.Subject = "Test Mail"; mm.Body = "This is a Test mail"; mm.IsBodyHtml = true; System.Net.Mail.SmtpClient ss = new System.Net.Mail.SmtpClient(); System.Net.Mail.MailAddress ma = new System.Net.Mail.MailAddress("test@test.com"); mm.To.Add(ma); ss.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.PickupDirectoryFromIis; ss.Host = "setyouripaddress her"; ss.Send(mm);
Koushik
-
my code is like this MailMessage mail=new MailMessage(); mail.To ="anu@gmail.com"; mail.From ="anu2@gmail.com"; mail.Subject = "Hai"; mail.Body = "your subject"; SmtpMail.Send(mail); it's executing.but i am not getting msg in my mail?what is the problem? When i am using this code Smtpmail.send(="anu@gmail.com","anu2@gmail.com","Hai","your subject") i am getting mail in anu2 can anyone tell what is the problem in above code? is there any thing i haveto set in webconfig file?Then How?....... Can anyone please help me?..it's urgent
i think your smtp have a prob try this its a working code hope your problem will solved and try to use "try/catch" in your code an then read the exception if code dont work that will explain you whats the problem..... try { MailMessage objMail; objMail = new MailMessage(); objMail.From = "Sender address"; objMail.To = "Recipient address"; objMail.Subject = "Subject of your mail"; objMail.BodyFormat = MailFormat.Html;//you can use text for text message objMail.Priority = MailPriority.High; objMail.Body = "Body of your mail"; SmtpMail.SmtpServer = "Your smtp server name"; SmtpMail.Send(objMail); objMail = null; } catch(Exception ex) { Response.Write(ex);//this will tell you the problem if got }
shezi
-
i think your smtp have a prob try this its a working code hope your problem will solved and try to use "try/catch" in your code an then read the exception if code dont work that will explain you whats the problem..... try { MailMessage objMail; objMail = new MailMessage(); objMail.From = "Sender address"; objMail.To = "Recipient address"; objMail.Subject = "Subject of your mail"; objMail.BodyFormat = MailFormat.Html;//you can use text for text message objMail.Priority = MailPriority.High; objMail.Body = "Body of your mail"; SmtpMail.SmtpServer = "Your smtp server name"; SmtpMail.Send(objMail); objMail = null; } catch(Exception ex) { Response.Write(ex);//this will tell you the problem if got }
shezi
-
Which OS you are using ?
Regards, Sylvester G sylvester_g_m@yahoo.com
-
Which OS you are using ?
Regards, Sylvester G sylvester_g_m@yahoo.com
-
my code is like this MailMessage mail=new MailMessage(); mail.To ="anu@gmail.com"; mail.From ="anu2@gmail.com"; mail.Subject = "Hai"; mail.Body = "your subject"; SmtpMail.Send(mail); it's executing.but i am not getting msg in my mail?what is the problem? When i am using this code Smtpmail.send(="anu@gmail.com","anu2@gmail.com","Hai","your subject") i am getting mail in anu2 can anyone tell what is the problem in above code? is there any thing i haveto set in webconfig file?Then How?....... Can anyone please help me?..it's urgent