hi
I am working on a asp.net web application that sends email to designated email ids. The platform is windows, c# and sql server2000. The email is working fine when I run it from localhost .but after hosting it on the server the email is not sent. I have opened the required port. please guide me what else may be the reason for the problem and also the solution. Please help.......
following is the source code
Thanx and regards,
Aradhana
I am working on a asp.net web application that sends email to designated email ids. The platform is windows, c# and sql server2000. The email is working fine when I run it from localhost .but after hosting it on the server the email is not sent. I have opened the required port. please guide me what else may be the reason for the problem and also the solution. Please help.......
following is the source code
Code:
System.Net.Mail.MailMessage Mail = new System.Net.Mail.MailMessage("trng.cg@gmail.com", tomail, submail, mesg);
Mail.IsBodyHtml = true;
System.Net.NetworkCredential mailAuthentication = new System.Net.NetworkCredential("trng.cg@gmail.com", "pwd");
System.Net.Mail.SmtpClient mailClient = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
mailClient.EnableSsl = true;
mailClient.UseDefaultCredentials = false;
mailClient.Credentials = mailAuthentication;
mailClient.Send(Mail);
Response.Write("msg sent succesful");
Aradhana
Comment