Hai there,
Check whether I configure it correctly...
And can explain me what is this 4 actually?
Check whether I configure it correctly...
Code:
myMsg.To.Add("some1@hotmail.com"); myMsg.From = new MailAddress("admin@emailserver.com"); smtp.Host = "mail.emailserver.com"; NetworkCred.UserName = "admin@emailserver.com";
Code:
MailMessage myMsg = new MailMessage(); myMsg.To.Add("some1@hotmail.com"); //TODO: Armour plate this method myMsg.From = new MailAddress("admin@emailserver.com"); myMsg.Subject = "Subject"; myMsg.Body = "Name : " + txtName.Text + "\n Designation : " + txtDesignation.Text + "\n Organisation : " + txtOrganisation.Text + "\n Contact Number : " + txtTel.Text + "\n Facsimile: " + txtFax.Text + "\n Email : " + txtEmail.Text + "\n Choosen Courses : " + txtChoosen.Text; ; SmtpClient smtp = new SmtpClient(); smtp.Host = "mail.emailserver.com"; smtp.EnableSsl = false; System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential(); NetworkCred.UserName = "admin@emailserver.com"; NetworkCred.Password = "password"; smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; //smtp.Port = 587; smtp.Send(myMsg); lblConfirm.Text = "Thank you for your enquiry. We will get back to you as soon as possible. Have a nice day.";
Comment