Send mail in c# code(asp.net 1.1)?
-
i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.
-
i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.
-
i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.
Use smtpserver out blank as below: SmtpMail.SmtpServer=""; or give ur smtp server according to ur smtp out as like below : SmtpMail.SmtpServer="mail.a2z.com" prabir
-
i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.
I had a similar problem a few weeks ago. It helped to set the smtp server to local host and not domain.com or mail.domain.com.
-
i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.
Hello, In my recent project I used sending mails functions. Actually 2 approaches are their. 1. In this case the mails go to bulk /spam folder 2. In 2nd approach mail will go to inbox(u r using authentication here as u have to mention uid/pwd of sending mailer) I am putting the exact codes that I have written previously. ______________________________________________________ 1st Approach
public void SendMail() { MailMessage msgMail=new MailMessage(); msgMail.To=emailTo; msgMail.From="test@test.com"; msgMail.Subject="test visitors mail"; msgMail.Body="whatever u want"; SmtpMail.SmtpServer = ""; SmtpMail.Send(msgMail); }
2nd Approach(same as 1st approach with some additional fields of authentication)public void SendMail() { MailMessage msgMail=new MailMessage(); msgMail.To=emailTo; msgMail.From="test@test.com"; msgMail.Subject="test visitors mail"; msgMail.Subject="test visitors mail"; msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "test@test.com"); //set your username here msgMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "testpassword"); //set your password here SmtpMail.SmtpServer = "mail.test.com" ;//put ur smtpout here SmtpMail.Send(msgMail); }
Thanks, Prabir -
i want to mail welcome message when a user register in my web site. i use the below code but it does'nt work. it's give me this error : (The"SendUsing" configuration value is invalid.) public static void Send(string mail,string sname,string sfamily) { MailMessage mailMsg = new MailMessage(); mailMsg .From = "info@mashhad915.com"; mailMsg .To =mail; mailMsg .Subject = "Welcome!"; mailMsg .Body ="welcome"; mailMsg.Bcc="info@mashhad915.com"; mailMsg.Cc="info@mashhad915.com"; SmtpMail.SmtpServer.Insert(0,"127.0.0.1"); SmtpMail.Send(mailMsg ); } please help me? it's very important for me.
Check out http://www.systemwebmail.com/[^]
Vasudevan Deepak Kumar Personal Homepage Tech Gossips