Advertisement

01.26.2008 at 05:45AM PST, ID: 23113345
[x]
Attachment Details

The transport failed to connect to the server.

Asked by newbieweb in Microsoft Visual C#.Net, Miscellaneous Web Development, .Net Editors & IDEs

Tags: failed, connect

I am trying to get my C#.NET program to send an email with code which used to work.  I do get warnings that the code is outdated.  Here it is.

Can anyone find the problem or simply have working code to take its place?  I just need to send an email.  The machine running my program will be an XP machine.

Thanks,
newbieweb


MailMessage mailMsg = new MailMessage();

mailMsg.From            = fromAddress;
mailMsg.To            = toAddress;
mailMsg.Subject            = subject;
mailMsg.Body            = messageBody;

mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");    
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "target@123.com");
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "123");

SmtpMail.SmtpServer = Configuration.SMTPServer;
SmtpMail.Send(mailMsg);
mailMsg = null;
Start Free Trial
 
 
[+][-]01.26.2008 at 06:07AM PST, ID: 20749712

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2008 at 06:18AM PST, ID: 20749735

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]01.26.2008 at 06:32AM PST, ID: 20749766

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.26.2008 at 09:18PM PST, ID: 20752481

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2008 at 09:31PM PST, ID: 20752523

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.26.2008 at 10:47PM PST, ID: 20752772

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.27.2008 at 06:56AM PST, ID: 20753900

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.27.2008 at 08:29AM PST, ID: 20754204

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Miscellaneous Web Development, .Net Editors & IDEs
Tags: failed, connect
Sign Up Now!
Solution Provided By: rhythmluvr
Participating Experts: 2
Solution Grade: A
 
 
[+][-]01.27.2008 at 02:32PM PST, ID: 20755567

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.27.2008 at 02:53PM PST, ID: 20755637

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.27.2008 at 06:58PM PST, ID: 20756508

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628