private void SendMail()
{
clGast.SelectById(clReservering.Gastid);
System.Net.Mail.MailMessage mailtje = new System.Net.Mail.MailMessage("norepy@robocamp.nl", clGast.pemail);
mailtje.Subject = "Bevestiging reservering Robocamp";
mailtje.Body = "Geachte meneer/mevrouw " + clGast.ptussenvoegsel + " " + clGast.pachternaam + ",\n\n";
mailtje.Body += "Hierbij de bevestiging van u reservering bij robocamp. Hieronder staan de gegevens nogmaals vermeld : \n\n";
mailtje.Body += "Van datum: " + clReservering.Datumstart + " \n";
mailtje.Body += "Tot datum: " + clReservering.Datumeind + " \n";
mailtje.Body += "Plaats nummer: " + clReservering.Plaatsid + " \n\n";
SmtpClient client = new SmtpClient();
client.Port = 25;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = false;
client.Host = "smtp.google.com";
client.Send(mailtje);
}
why is this not working?
unable to send mail. Smtp failure?
clGast.pemail is an email adress. active and working.
Error is :
SmtpException was unhandeled
Failure sending mail
anyone?