Hi
I am sending an email using gmailaccount here.
using System.Net.Mail;
private void button1_Click(object sender, RoutedEventArgs e)
{
string footer = "If you have any questions about appointment";
string subject = "Appointment Canceled";
string body = "Hi" + " " + "sent from google" + "\n\n" + footer;
MailMessage message = new MailMessage();
message.From = new MailAddress("Ngqandu.Anele@gmail.com");
message.To.Add(new MailAddress("Anele.Ngqandu@live.nmmu.ac.za"));
message.Subject = subject;
message.Body = body;
SmtpClient client = new SmtpClient();
client.Credentials = new System.Net.NetworkCredential("Ngqandu.Anele@gmail.com", "myGMAILpassword");
client.Port = 587;
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
try
{
client.Send(message);
}
catch (Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
vote if it helps...