Click here to Skip to main content
15,919,336 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Exception information detail Pin
Luc Pattyn15-Feb-08 7:30
sitebuilderLuc Pattyn15-Feb-08 7:30 
GeneralRe: Exception information detail Pin
Luc Pattyn15-Feb-08 7:22
sitebuilderLuc Pattyn15-Feb-08 7:22 
GeneralRe: Exception information detail Pin
cstrader23215-Feb-08 7:45
cstrader23215-Feb-08 7:45 
GeneralRe: Exception information detail Pin
Luc Pattyn15-Feb-08 7:49
sitebuilderLuc Pattyn15-Feb-08 7:49 
GeneralRe: Exception information detail Pin
cstrader23215-Feb-08 10:15
cstrader23215-Feb-08 10:15 
GeneralRe: Exception information detail Pin
supercat918-Feb-08 6:16
supercat918-Feb-08 6:16 
GeneralRe: Exception information detail Pin
Luc Pattyn18-Feb-08 9:06
sitebuilderLuc Pattyn18-Feb-08 9:06 
GeneralNET 1.1 SMTP problem : "The transport failed to connect to the server." [modified] Pin
Stortman15-Feb-08 4:07
Stortman15-Feb-08 4:07 
My VS2003 web application written in VB.NET works as required on my XP Pro desktop platform using .Net Framework 1.1, IIS 6.0 a local MSDE database. It uses System.Web.Mail to send emails via my ISP's web server which requires authentication. Everything works fine. Emails are sent ok.

However, when I migrate the application to my separate web server (Windows Server 2003, .Net Framework 1.1, IIS 6.0 ) and my separate database server (Windows Server 2000, SQL Server) the emails are not sent and I get the message "The transport failed to connect to the server."

Could this be a configuration issue with my web server? Or could it be the SMTP access coded in VB is missing something that is defaulted to on my desktop platform?

My VB code is as follows:-

Dim strBody As String
Dim msgEmail As MailMessage = New MailMessage
' provide external mail server with authentication for outgoing mail
Dim strUserName As String = "myname@MyEmail.com"
Dim strPassword As String = "MyPassword"
Dim intCdoBasic As Integer = 1
msgEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", intCdoBasic)
msgEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", strUserName)
msgEmail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", strPassword)
msgEmail.Subject = "My Subject: "
msgEmail.BodyFormat = MailFormat.Html
msgEmail.Body = BuildBody() 'build html and copy to body
msgEmail.To = "TargetName@TargetDomain.com"
msgEmail.Priority = MailPriority.High
msgEmail.From = “SourceName@Domain.com”
SmtpMail.SmtpServer = "mail.MyISP.com" 'as provided by ISP
System.Web.Mail.SmtpMail.Send(msgEmail)

I get the following error stack:-

Server Error in '/' Application.
--------------------------------------------------------------------------------

The transport failed to connect to the server.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: The transport failed to connect to the server.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[COMException (0x80040213): The transport failed to connect to the server.
]

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) +113
System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1848
System.Web.Mail.SmtpMail.Send(MailMessage message) +150
OMOT_booking.SubmitRequest.SendPayReq(String strIref)
OMOT_booking.SubmitRequest.btnNext_Click(Object sender, EventArgs e)
System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +108
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +138
System.Web.UI.Page.ProcessRequestMain() +1292

modified on Friday, February 15, 2008 11:06 AM

GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Dave Kreskowiak15-Feb-08 4:30
mveDave Kreskowiak15-Feb-08 4:30 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Stortman15-Feb-08 5:32
Stortman15-Feb-08 5:32 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Dave Kreskowiak15-Feb-08 5:49
mveDave Kreskowiak15-Feb-08 5:49 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Stortman15-Feb-08 11:06
Stortman15-Feb-08 11:06 
GeneralRe: NET 1.1 SMTP problem : "The transport failed to connect to the server." Pin
Stortman15-Feb-08 13:58
Stortman15-Feb-08 13:58 
GeneralOpening VS2005 Project in VS2008 Pin
plural15-Feb-08 3:11
plural15-Feb-08 3:11 
GeneralRe: Opening VS2005 Project in VS2008 Pin
Dave Kreskowiak15-Feb-08 4:26
mveDave Kreskowiak15-Feb-08 4:26 
GeneralRe: Opening VS2005 Project in VS2008 Pin
plural15-Feb-08 4:37
plural15-Feb-08 4:37 
QuestionTop most question? Pin
Benny_Lava15-Feb-08 2:35
Benny_Lava15-Feb-08 2:35 
GeneralRe: Top most question? Pin
Dave Kreskowiak15-Feb-08 4:23
mveDave Kreskowiak15-Feb-08 4:23 
GeneralRe: Top most question? Pin
Luc Pattyn15-Feb-08 6:08
sitebuilderLuc Pattyn15-Feb-08 6:08 
QuestionHardware interface from vb.net,c#,vb6. Pin
aamn115-Feb-08 2:18
aamn115-Feb-08 2:18 
GeneralRe: Hardware interface from vb.net,c#,vb6. Pin
Dave Kreskowiak15-Feb-08 4:15
mveDave Kreskowiak15-Feb-08 4:15 
General'UPGRADE_WARNING: Couldn't resolve default property of object Pin
sarat15-Feb-08 1:40
sarat15-Feb-08 1:40 
GeneralRe: 'UPGRADE_WARNING: Couldn't resolve default property of object Pin
Dave Kreskowiak15-Feb-08 4:10
mveDave Kreskowiak15-Feb-08 4:10 
QuestionPrinting from VB.Net Pin
Senthil_M15-Feb-08 1:34
Senthil_M15-Feb-08 1:34 
GeneralRe: Printing from VB.Net Pin
Dave Kreskowiak15-Feb-08 4:13
mveDave Kreskowiak15-Feb-08 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.