Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2014-07-15
3
Medium Priority
?
89 Views
Last Modified: 2016-06-21
I created Send Email functionality as suggested in below ...

http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_28469071.html 


 string txtEMailFrom = "DoNotReply@XX.com";
 SmtpClient clientServer = new SmtpClient("smtp55.XX.com");
 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;                
 clientServer.Send(msg);          

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 ?
0
Comment
Question by:anbu210
3 Comments
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 40196346
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.
0
 

Accepted Solution

by:
anbu210 earned 0 total points
ID: 40229589
Never mind, Looks like port issue on the server. Server Team working on enabling Port 25.
0
 
LVL 5

Expert Comment

by:Tom Knowlton
ID: 41664193
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.

knowlton
Experts-Exchange Cleanup Volunteer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Suggested Courses

571 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