sending email functionality not working on server, but works in local machine.

Posted on 2014-07-15
Last Modified: 2016-06-21
I created Send Email functionality as suggested in below ...

 string txtEMailFrom = "";
 SmtpClient clientServer = new SmtpClient("");
 MailMessage msg = new MailMessage();
 msg.From = new MailAddress(txtEMailFrom);
 msg.To.Add(new MailAddress(ClientEmail));
 msg.Subject = SubjectLine;
 msg.IsBodyHtml = true;
 msg.Body = Message;
 clientServer.UseDefaultCredentials = true;                

It works fine when running in VS2012 or deploying in local machine IIS. However when deployed to test server (WIN server 2008 R2)  getting an exception "Unable to connect to remote server"

Any ideas ?
Question by:anbu210
    LVL 29

    Expert Comment

    by:Gautham Janardhan
    can u post ur service method.. most likely u are getting an error in ur service method. if you are not doing any other sort of error handling.. wrap this piece of code in a try catch and try to log/send the error.

    Accepted Solution

    Never mind, Looks like port issue on the server. Server Team working on enabling Port 25.
    LVL 5

    Expert Comment

    No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

    I have recommended this question be closed as follows:

    Accept: anbu210 (https:#a40229589)

    If you feel this question should be closed differently, post an objection and the moderators will review all objections and close it as they feel fit. If no one objects, this question will be closed automatically the way described above.

    Experts-Exchange Cleanup Volunteer

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction HyperText Transfer Protocol ( or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
    Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
    This video teaches users how to migrate an existing Wordpress website to a new domain.
    Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    25 Experts available now in Live!

    Get 1:1 Help Now