I try to send email from my application. Everything seems ok, mailmessage, credentials etc.
When I debug the code it doesnt fall in to catch exception and doesnt send email. Also there is no mail queue at the server.There is no error message.
msgObj.Subject = this.Subject;
msgObj.From = new MailAddress(this.From , this.Display_Name);//
msgObj.Body = this.Message;
msgObj.IsBodyHtml = true;
SmtpClient client = new SmtpClient(this.SMTP_Server,25);
client.Credentials = new System.Net.NetworkCredential(SMTP_User + "@doping.com.tr", SMTP_Password);
try
{
client.Send(msgObj);
return true;
}
catch (Exception ex)
{
ex.ToString();
return false;
}
What could be the problem?
Thanks.
The default settings of an
SmtpClientcan be configured using theSystem.Netconfiguration namespace, e.g:See the <smtp> Element (Network Settings) topic for more information.