Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
May i know how to send mail using wireless connection in c#.net?
Posted
Comments
Mohd. Mukhtar 23-Nov-12 1:52am    
Please explane what you want to do?
ridoy 23-Nov-12 3:00am    
Is it message sending via bluetooth?

C#
System.Net.Mail.MailMessage mail = new System.Net.Mail.MailMessage();
           SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");

           mail.From = new MailAddress("Sender email id"); // enter senders email address here
           mail.To.Add("receivers email id");
           mail.Subject = "subject";
           mail.Body = "avc";
         //  Attachment data = new Attachment("D:\\file.bmp");
           //  Attachment data = new Attachment(@"D:\file.pdf");
         //  mail.Attachments.Add(data);
           SmtpServer.Port = 587;
           SmtpServer.Credentials = new System.Net.NetworkCredential("Sender ", "password"); ///// enter email address of the sender nd password of the sender here in parameters
           SmtpServer.EnableSsl = true;

           SmtpServer.Send(mail);
 
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