hi guys,
I have been facing a problem in sending a mail to my mail box on the contact us page.
Code:
MailMessage Msg = new MailMessage();
Msg.From = new MailAddress(txtEmail.Text);
Msg.To.Add("info@mydomain.com");
Msg.Subject = txtSubject.Text;
Msg.Body = txtMessage.Text;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.zoho.com";
smtp.Port = 465;
smtp.UseDefaultCredentials = false;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new System.Net.NetworkCredential("info@mydomain.com", "password");
smtp.EnableSsl = true;
smtp.Timeout = 20000;
smtp.Send(Msg);
Do I need some web.config entry ? Since I have removed the mailsettings tag as I was declaring everything in the C# code itself.
Please help ASAP
Regards,
Dev
Go to the complete details ...