Wrox Programmer Forums
|
BOOK: Beginning ASP.NET Dynamic Websites w/ Web Matrix
This is the forum to discuss the Wrox book Beginning Dynamic Websites: with ASP.NET Web Matrix by Dave Sussman, James Greenwood, Alex Homer, Colt Kwong, John M. West; ISBN: 9780764543746
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET Dynamic Websites w/ Web Matrix section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 10th, 2003, 03:51 PM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default function.aspx

I have these code from function.aspx

Sub Button1_Click(sender As Object, e As EventArgs)
   ' Call the SendMail function, and set Label1.Text to the
   ' recipient's e-mail address
   Label1.Text = SendMail("Feedback form", TextBox1.Text, TextBox2.Text)
End Sub

Function SendMail(Subject As String, FromAddress As String, _
   Message As String) As String


' Build a MailMessage
Dim mailMessage As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage
mailMessage.From = "[email protected]"
mailMessage.To = "[email protected]"
mailMessage.Subject = "Sending an e-mail from a web page"
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text

' TODO: Set the mailMessage.Body property
mailMessage.Body = Message

System.Web.Mail.SmtpMail.SmtpServer = "mail.Fil-Can.ca"
System.Web.Mail.SmtpMail.Send(mailMessage)

SendMail = "Your message was sent to " & mailMessage.To

End Function


and I got these error message when I clicked the send button from chapter 4 function.aspx

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:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

  <%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
   <system.web>
       <compilation debug="true"/>
   </system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

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(O bject obj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
   System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args) +112
   System.Web.Mail.CdoSysHelper.Send(MailMessage message) +1728
   System.Web.Mail.SmtpMail.Send(MailMessage message) +150
   ASP.Email_aspx.SendMail(String Subject, String FromAddress, String Message) +104
   ASP.Email_aspx.Button1_Click(Object sender, EventArgs e) +58
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +83
   System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1277

Thank you in advance






 
Old August 11th, 2003, 04:23 AM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think, this is error related to

System.Web.Mail.SmtpMail.SmtpServer = "mail.Fil-Can.ca"

Does this server runs perfectly in OutLook/OutLook express or any email client ?



Vipul.
 
Old August 12th, 2003, 08:54 AM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Vrsolanki,

  System.Web.Mail.SmtpMail.SmtpServer = "mail.Fil-Can.ca" it does, I'm using outlook express.
Thank your for your reply,
amonastrial

 
Old August 14th, 2003, 08:53 PM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you check if SMTP service is installed on your wwb server?

If you check and SMTP service is installed on your web server,
Then you can do is to check if the smptp server can be connected on your web server machine.

Shin Kyoun(Stanley) CHOI



 
Old April 18th, 2005, 01:04 AM
Registered User
 
Join Date: Apr 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have foudn same error after setting the smtp mail server information. This error comes on the local machine .
System.Web.Mail.SmtpMail.SmtpServer="localhost";


************************************************** ****************
Line 734:
Line 735:newMsg.Body =mailBody.ToString();
Line 736: System.Web.Mail.SmtpMail.Send(newMsg);
Line 737:}
Line 738:if(Issue_assigned_to.Text!=Response_assigned_t o.SelectedItem.Text&& Int32.Parse(Utility.Dlookup("users","notify_new"," user_name='" + Response_assigned_to.SelectedItem.Text+"'"))==1)


Source File: d:\project\issuemanager\issuechange.cs Line: 736

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.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) +29
   System.Web.Mail.LateBoundAccessHelper.CallMethod(T ype type, Object obj, String methodName, Object[] args)
   System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args)

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
   System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String methodName, Object[] args)
   System.Web.Mail.CdoSysHelper.Send(MailMessage message)
   System.Web.Mail.SmtpMail.Send(MailMessage message)
   IssueManager.IssueChange.Response_insert_Click(Obj ect Src, EventArgs E) in d:\project\issuemanager\issuechange.cs:736
   IssueManager.IssueChange.Response_Action(Object Src, EventArgs E) in d:\project\issuemanager\issuechange.cs:779
   System.Web.UI.HtmlControls.HtmlInputButton.OnServe rClick(EventArgs e)
   System.Web.UI.HtmlControls.HtmlInputButton.System. Web.UI.IPostBackEventHandler.RaisePostBackEvent(St ring eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
   System.Web.UI.Page.ProcessRequestMain()




 
Old September 23rd, 2005, 08:46 AM
Registered User
 
Join Date: Sep 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I got the same problem. But the funny thing is, it works locally but NOT when I upload my page to the webserver.

This is my code:

Dim mail as New MailMessage()

mail.To = "[email protected]"
mail.From = "[email protected]"
mail.Subject = "Test"
mail.Body = "Test"
mail.BodyFormat = MailFormat.Text
mail.Priority = MailPriority.Normal

mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", "2")
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", "mail.investorflash.com")
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", 25)
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username)
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pword)
mail.Fields.Add

SmtpMail.Send(mail)


 
Old February 20th, 2006, 05:49 PM
Registered User
 
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't offer help, I need clarification about your smtp servers.
Why are you using 'mail.---' instead of 'smtp-server.---'
I have only used the likes of smtp-server.cfl.r.com and others isp's like this, butnever mail.-.-.
Is that because they are web based mail servers like yahoo??






Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling codebehind C# function from aspx page ravindrasingh77 BOOK: ASP.NET Website Programming Problem-Design-Solution 2 March 16th, 2005 12:08 AM
Calling a function from .vb file to aspx file !! NitinJoshi General .NET 4 February 10th, 2005 06:23 AM
Call codebehind function from ASPX collie VB.NET 2002/2003 Basics 1 September 2nd, 2004 03:31 AM
HowTo Pass Form data from Page1.aspx to Page2.aspx dati ASP.NET 1.0 and 1.1 Basics 6 January 27th, 2004 06:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.