troubleshooting Question

C# bulk mail

Avatar of vikalgupta
vikalguptaFlag for India asked on
.NET Programming
2 Comments2 Solutions356 ViewsLast Modified:

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
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 ;          

Open in new window

Join our community to see this answer!
Unlock 2 Answers and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros