Click here to Skip to main content
15,911,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
asp.net c# code to send mail eithout using IP address
Posted
Comments
comred 2-May-12 0:37am    
Your question is not clear.. would you elaborate more??
Sandeep Mewara 2-May-12 2:42am    
Did you try anything?

C#
var mail = new MailMessage();
                        mail.From = new MailAddress("Email adress");
                        mail.To.Add("to Email");

                        mail.Subject = "Event Information";
                        mail.IsBodyHtml = true;
                        mail.Body = "body";
                        var mailClient = new SmtpClient("smtp.gmail.com", 587);
                        mailClient.EnableSsl = true;
                        mailClient.Credentials = new System.Net.NetworkCredential("Email", "password");
                        mailClient.Send(mail);
 
Share this answer
 
v2
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900