SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress("[email protected]", "Lenin");
smtpClient.Host = "localhost";
//smtpClient.Host = "";
//smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add("[email protected]");
message.Subject = "Feedback";
//message.CC.Add("admin1@ gmail.com");
//message.CC.Add("admin2@ gmail.com");
// message.Bcc.Add(new MailAddress("admin3@ gmail.com"));
// message.Bcc.Add(new MailAddress("admin4@ gmail.com"));
message.IsBodyHtml = false;
message.Body = txtComments.Text;
smtpClient.Send(message);
MessageBox.Show("Email successfully sent.");
}
catch (Exception ex)
{
MessageBox.Show("Send Email Failed." + ex.Message);
}
please help to sent email to different server .. gmail.com/yahoo.com/inbox.com ..etc using windows application. thanks for the help.