vikalgupta
asked on
C# bulk mail
Hi,
We are facing problem while sending mail using third party SMTP relay. Error encountered as Operation time out and Failure sending mail. Error encountered unexpectedly and as discussed with vendor he is saying that there is some issue in application. But when we try to resend its working. below is the code snippet used:-
We have created a window service which is picking up the data from database and sending using the below code snippet
We are facing problem while sending mail using third party SMTP relay. Error encountered as Operation time out and Failure sending mail. Error encountered unexpectedly and as discussed with vendor he is saying that there is some issue in application. But when we try to resend its working. below is the code snippet used:-
We have created a window service which is picking up the data from database and sending using the below code snippet
try
{
SmtpClient mailSender = new SmtpClient();
mailSender.Host =’XXXX’;
mailSender.Port = Convert.ToInt32(25);
mailSender.Credentials = new System.Net.NetworkCredential(‘XXX’, ‘XXX’);
mailSender.Send(object of mail message);
response.SUCCESSFLAG = true;
response.RESPONSESTATUS = "SUCCESS";
response.RESPONSEMESSAGE = "Successfully sent email";
}
catch(Exception ex)
{
response.SUCCESSFLAG = false;
response.RESPONSESTATUS = "FAIL";
response.RESPONSEMESSAGE = ex.Message ;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.