Link to home
Start Free TrialLog in
Avatar of cuongnd
cuongnd

asked on

how can i send an email to an exchange email in asp.net?

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();            
 
            try
            {
                MailAddress fromAddress = new MailAddress("acb@email.com");
                smtpClient.Host = "localhost";
                smtpClient.Port = 25;
                message.From = fromAddress;
                Email send to
                message.To.Add("def@def.com");//this is an exchange account
                message.Subject = txtTitle.Text;
                message.IsBodyHtml = false;
                message.Body = txtDescription.Text;
                smtpClient.Send(message);
          }
            catch (Exception ex)
            {
                
            }

Open in new window

Avatar of Avodah
Avodah
Flag of United Kingdom of Great Britain and Northern Ireland image

do you get an exception? if so what are the details?
Avatar of cuongnd
cuongnd

ASKER

No, I didn't get any exception. Thanks a lot.
ASKER CERTIFIED SOLUTION
Avatar of Avodah
Avodah
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cuongnd

ASKER

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