Click here to Skip to main content
15,890,609 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
I am banjar :-D how to send and receive Mail from one person wrote a letter and send it to someone else and this message contains attachments of voice and image to another
Posted
Updated 6-Dec-09 9:47am
v2

try this one it may help you to send email

protected void sendEmail(string address, string subject, string from, string body)
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
message.To.Add(address);
message.Subject = subject;
message.From = new System.Net.Mail.MailAddress(from);
message.Body = body;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient("smtp.gmail.com");
smtp.Credentials = new System.Net.NetworkCredential("host", "password");
smtp.Port = 587;
smtp.Send(message);

}
 
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