how can i send an email to an exchange email in

Posted on 2009-02-19
Last Modified: 2012-05-06
I have a feedback page. But i can not program to send a reply mail to an exchange email. Any one help me?
SmtpClient smtpClient = new SmtpClient();

            MailMessage message = new MailMessage();            



                MailAddress fromAddress = new MailAddress("");

                smtpClient.Host = "localhost";

                smtpClient.Port = 25;

                message.From = fromAddress;

                Email send to

                message.To.Add("");//this is an exchange account

                message.Subject = txtTitle.Text;

                message.IsBodyHtml = false;

                message.Body = txtDescription.Text;



            catch (Exception ex)




Open in new window

Question by:cuongnd
    LVL 18

    Expert Comment

    by:Richard Lee
    do you get an exception? if so what are the details?

    Author Comment

    No, I didn't get any exception. Thanks a lot.
    LVL 18

    Accepted Solution

    Firstly if the mail does not reach the destination it could be that the destination server has criteria for accepting mail.

    Secondly, and what may be the answer is that you are catching the exception with an empty catch block. Remove the try / catch and see what happens.

    Author Closing Comment

    Hi, DaTribe
    I think this error may be because the criteria of mail server. Thank you so much

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    A Change in PHP Behavior with Session Write Short Circuit ( (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
    Using Quotation Marks in PHP This question ( seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
    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…
    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.

    779 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

    9 Experts available now in Live!

    Get 1:1 Help Now