473,606 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in Senting E-Mail using the SmtpMail

Hi !

I wrote one code for Send the E-mail, But that code have some problem , So please help me

Here i paste my code and Error:
Error:
Server Error in '/Elan_Sample' 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:
Line 36: Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Line 37: SmtpMail.SmtpSe rver = "trainee2.c om" ' Trainee2.com is my SMTP Name
Line 38: SmtpMail.Send(t xtFrom.Text, txtTo.Text, txtSubject.Text , txtBody.Text)
Line 39: End Sub
Line 40: End Class

Source File: C:\Project Files\Root\Elan _Sample\Email Server.aspx.vb Line: 38

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

[TargetInvocatio nException: Exception has been thrown by the target of an invocation.]
System.RuntimeT ype.InvokeDispM ethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters ) +0
System.RuntimeT ype.InvokeMembe r(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifi er[] modifiers, CultureInfo culture, String[] namedParameters ) +473
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String methodName, Object[] args) +112
System.Web.Mail .CdoSysHelper.S end(MailMessage message) +1840
System.Web.Mail .CdoSysHelper.S end(String from, String to, String subject, String messageText) +74
System.Web.Mail .SmtpMail.Send( String from, String to, String subject, String messageText) +171
Elan_Sample.Ema il_Server.Butto n1_Click(Object sender, EventArgs e) in C:\Project Files\Root\Elan _Sample\Email Server.aspx.vb: 38
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1277




ASP.NET Script :

<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Ema il Server.aspx.vb" Inherits="Elan_ Sample.Email_Se rver"%>
OCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

<title>Email_Se rver</title>

<meta name="GENERATOR " content="Micros oft Visual Studio.NET 7.0">

<meta name="CODE_LANG UAGE" content="Visual Basic 7.0">

<meta name="vs_defaul tClientScript" content="JavaSc ript">

<meta name="vs_target Schema" content="http://schemas.microso ft.com/intellisense/ie5">

</HEAD>

<body MS_POSITIONING= "GridLayout ">

<form id="Form1" method="post" runat="server">

<asp:TextBox id="txtFrom" style="Z-INDEX: 100; LEFT: 190px; POSITION: absolute; TOP: 62px" runat="server"> </asp:TextBox>

<asp:Label id="Label8" style="Z-INDEX: 113; LEFT: 99px; POSITION: absolute; TOP: 212px" runat="server" Width="68px" Height="19px">B ody</asp:Label>

<asp:Label id="Label7" style="Z-INDEX: 112; LEFT: 99px; POSITION: absolute; TOP: 156px" runat="server" Width="68px" Height="19px">S ubject</asp:Label>

<asp:Label id="Label6" style="Z-INDEX: 111; LEFT: 99px; POSITION: absolute; TOP: 109px" runat="server" Width="68" Height="19">To</asp:Label>

<asp:TextBox id="txtBody" style="Z-INDEX: 109; LEFT: 192px; POSITION: absolute; TOP: 210px" runat="server"> </asp:TextBox>

<asp:Label id="Label4" style="Z-INDEX: 102; LEFT: 126px; POSITION: absolute; TOP: 64px" runat="server"> Label</asp:Label>

<asp:TextBox id="txtSubject " style="Z-INDEX: 108; LEFT: 193px; POSITION: absolute; TOP: 157px" runat="server"> </asp:TextBox>

<asp:Label id="Label3" style="Z-INDEX: 101; LEFT: 126px; POSITION: absolute; TOP: 64px" runat="server"> Label</asp:Label>

<asp:TextBox id="txtTo" style="Z-INDEX: 107; LEFT: 192px; POSITION: absolute; TOP: 106px" runat="server"> </asp:TextBox>

<asp:Label id="Label2" style="Z-INDEX: 103; LEFT: 126px; POSITION: absolute; TOP: 64px" runat="server"> Label</asp:Label>

<asp:Label id="Label1" style="Z-INDEX: 104; LEFT: 99px; POSITION: absolute; TOP: 64px" runat="server" Width="68px" Height="19px">F orm</asp:Label>

<asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 291px; POSITION: absolute; TOP: 276px" runat="server" Text="Sent" Width="65px"></asp:Button>

</form>

</body>

</HTML>

Server side Script:

Imports System.Web.Mail

Public Class Email_Server

Inherits System.Web.UI.P age

Protected WithEvents txtFrom As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label1 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Button1 As System.Web.UI.W ebControls.Butt on

Protected WithEvents Label2 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtTo As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label3 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtSubject As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label4 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtBody As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label6 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Label7 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Label8 As System.Web.UI.W ebControls.Labe l

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnos tics.DebuggerSt epThrough()> Private Sub InitializeCompo nent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeCompo nent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load

'Put user code to initialize the page here

End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

SmtpMail.SmtpSe rver = "trainee2.c om" ' Trainee2.com is my SMTP Name

SmtpMail.Send(t xtFrom.Text, txtTo.Text, txtSubject.Text , txtBody.Text)

End Sub

End Class

--------------------------------------------------------------------------
Thanks & Regards,
ElanKathir.S.N,
ASM Technologies,
B'lore.

Nov 18 '05 #1
5 2138
Hi,

SMTP FAQ
http://www.asp.net/Forums/ShowPost.a...&PostID=268037

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"ElanKathir " <sn**********@h otmail.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi !

I wrote one code for Send the E-mail, But that code have some problem , So
please help me

Here i paste my code and Error:
Error:
Server Error in '/Elan_Sample' 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:
Line 36: Private Sub Button1_Click(B yVal sender As System.Object, ByVal
e As System.EventArg s) Handles Button1.Click
Line 37: SmtpMail.SmtpSe rver = "trainee2.c om" ' Trainee2.com is my
SMTP Name
Line 38: SmtpMail.Send(t xtFrom.Text, txtTo.Text, txtSubject.Text ,
txtBody.Text)
Line 39: End Sub
Line 40: End Class

Source File: C:\Project Files\Root\Elan _Sample\Email Server.aspx.vb Line:
38

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

[TargetInvocatio nException: Exception has been thrown by the target of an
invocation.]
System.RuntimeT ype.InvokeDispM ethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters ) +0
System.RuntimeT ype.InvokeMembe r(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifi er[] modifiers,
CultureInfo culture, String[] namedParameters ) +473
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String
methodName, Object[] args) +112
System.Web.Mail .CdoSysHelper.S end(MailMessage message) +1840
System.Web.Mail .CdoSysHelper.S end(String from, String to, String subject,
String messageText) +74
System.Web.Mail .SmtpMail.Send( String from, String to, String subject,
String messageText) +171
Elan_Sample.Ema il_Server.Butto n1_Click(Object sender, EventArgs e) in
C:\Project Files\Root\Elan _Sample\Email Server.aspx.vb: 38
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1277


ASP.NET Script :

<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Ema il
Server.aspx.vb" Inherits="Elan_ Sample.Email_Se rver"%>
OCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

<title>Email_Se rver</title>

<meta name="GENERATOR " content="Micros oft Visual Studio.NET 7.0">

<meta name="CODE_LANG UAGE" content="Visual Basic 7.0">

<meta name="vs_defaul tClientScript" content="JavaSc ript">

<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">

</HEAD>

<body MS_POSITIONING= "GridLayout ">

<form id="Form1" method="post" runat="server">

<asp:TextBox id="txtFrom" style="Z-INDEX: 100; LEFT: 190px; POSITION:
absolute; TOP: 62px" runat="server"> </asp:TextBox>

<asp:Label id="Label8" style="Z-INDEX: 113; LEFT: 99px; POSITION: absolute;
TOP: 212px" runat="server" Width="68px" Height="19px">B ody</asp:Label>

<asp:Label id="Label7" style="Z-INDEX: 112; LEFT: 99px; POSITION: absolute;
TOP: 156px" runat="server" Width="68px" Height="19px">S ubject</asp:Label>

<asp:Label id="Label6" style="Z-INDEX: 111; LEFT: 99px; POSITION: absolute;
TOP: 109px" runat="server" Width="68" Height="19">To</asp:Label>

<asp:TextBox id="txtBody" style="Z-INDEX: 109; LEFT: 192px; POSITION:
absolute; TOP: 210px" runat="server"> </asp:TextBox>

<asp:Label id="Label4" style="Z-INDEX: 102; LEFT: 126px; POSITION: absolute;
TOP: 64px" runat="server"> Label</asp:Label>

<asp:TextBox id="txtSubject " style="Z-INDEX: 108; LEFT: 193px; POSITION:
absolute; TOP: 157px" runat="server"> </asp:TextBox>

<asp:Label id="Label3" style="Z-INDEX: 101; LEFT: 126px; POSITION: absolute;
TOP: 64px" runat="server"> Label</asp:Label>

<asp:TextBox id="txtTo" style="Z-INDEX: 107; LEFT: 192px; POSITION:
absolute; TOP: 106px" runat="server"> </asp:TextBox>

<asp:Label id="Label2" style="Z-INDEX: 103; LEFT: 126px; POSITION: absolute;
TOP: 64px" runat="server"> Label</asp:Label>

<asp:Label id="Label1" style="Z-INDEX: 104; LEFT: 99px; POSITION: absolute;
TOP: 64px" runat="server" Width="68px" Height="19px">F orm</asp:Label>

<asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 291px; POSITION:
absolute; TOP: 276px" runat="server" Text="Sent" Width="65px"></asp:Button>

</form>

</body>

</HTML>

Server side Script:

Imports System.Web.Mail

Public Class Email_Server

Inherits System.Web.UI.P age

Protected WithEvents txtFrom As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label1 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Button1 As System.Web.UI.W ebControls.Butt on

Protected WithEvents Label2 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtTo As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label3 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtSubject As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label4 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtBody As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label6 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Label7 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Label8 As System.Web.UI.W ebControls.Labe l

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnos tics.DebuggerSt epThrough()> Private Sub InitializeCompo nent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeCompo nent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

'Put user code to initialize the page here

End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

SmtpMail.SmtpSe rver = "trainee2.c om" ' Trainee2.com is my SMTP Name

SmtpMail.Send(t xtFrom.Text, txtTo.Text, txtSubject.Text , txtBody.Text)

End Sub

End Class

--------------------------------------------------------------------------
Thanks & Regards,
ElanKathir.S.N,
ASM Technologies,
B'lore.
Nov 18 '05 #2
Hi Teemu Keiski,

This is my Code,

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim mailMessage As System.Web.Mail .MailMessage

mailMessage = New System.Web.Mail .MailMessage()

mailMessage.Fro m = "me@contoso .com "

mailMessage.To = "yo*@contoso.co m "

mailMessage.Sub ject = "Test subject"

mailMessage.Bod yFormat = System.Web.Mail .MailFormat.Tex t

mailMessage.Bod y = "Testing email "

System.Web.Mail .SmtpMail.SmtpS erver = "localhost"

Try

System.Web.Mail .SmtpMail.Send( mailMessage)
Response.Write( "Message sent!")

Catch ex As Exception

Response.Write( ex.Message)

End Try
End Sub
I add Referce also (Add the cdosys.dll), But i got the One Error
massage:

Could not access 'CDO.Message' object.

Why this Came ?..........

Thanks & Regards

Elankathir,
B'lore,
India.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3
ElanKathir .S.N <el************ *@yahoo.co.in> wrote in news:OyQGc1F9DH A.1596
@TK2MSFTNGP10.p hx.gbl:
Could not access 'CDO.Message' object.

Why this Came ?..........


Do you have CDO installed?

You might also try Indy, its free and has broader support for SMTP than .net
does.

http://www.indyproject.org/

There is an SMTP example at:
http://www.atozed.com/indy/

Indy does not require CDO.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"
ELKNews - Get your free copy at http://www.atozedsoftware.com

Nov 18 '05 #4
Change
Catch ex As Exception
Response.Write( ex.Message)
To
Catch ex As Exception
Response.Write( ex.InnerExcepti on.Message)

That should give you a better clue as to where the problem lies.

"ElanKathir .S.N" <el************ *@yahoo.co.in> wrote in message
news:Oy******** ******@TK2MSFTN GP10.phx.gbl...
Hi Teemu Keiski,

This is my Code,

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click

Dim mailMessage As System.Web.Mail .MailMessage

mailMessage = New System.Web.Mail .MailMessage()

mailMessage.Fro m = "me@contoso .com "

mailMessage.To = "yo*@contoso.co m "

mailMessage.Sub ject = "Test subject"

mailMessage.Bod yFormat = System.Web.Mail .MailFormat.Tex t

mailMessage.Bod y = "Testing email "

System.Web.Mail .SmtpMail.SmtpS erver = "localhost"

Try

System.Web.Mail .SmtpMail.Send( mailMessage)
Response.Write( "Message sent!")

Catch ex As Exception

Response.Write( ex.Message)

End Try
End Sub
I add Referce also (Add the cdosys.dll), But i got the One Error
massage:

Could not access 'CDO.Message' object.

Why this Came ?..........

Thanks & Regards

Elankathir,
B'lore,
India.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #5
Hi ElanKathir,

I don't think SMTP virtual server is installed on your IIS.it is part of IIS but you need to install it.
Go to your IIS and look for Default SMTP Virtiual Server.If it is not there install it using the Windows CD.
Here is link which will help you on that.
http://www.microsoft.com/technet/tre...mail_setup.asp
Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com
"ElanKathir " <sn**********@h otmail.com> wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. ..
Hi !

I wrote one code for Send the E-mail, But that code have some problem , So please help me

Here i paste my code and Error:
Error:
Server Error in '/Elan_Sample' 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:
Line 36: Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Line 37: SmtpMail.SmtpSe rver = "trainee2.c om" ' Trainee2.com is my SMTP Name
Line 38: SmtpMail.Send(t xtFrom.Text, txtTo.Text, txtSubject.Text , txtBody.Text)
Line 39: End Sub
Line 40: End Class
Source File: C:\Project Files\Root\Elan _Sample\Email Server.aspx.vb Line: 38

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

[TargetInvocatio nException: Exception has been thrown by the target of an invocation.]
System.RuntimeT ype.InvokeDispM ethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters ) +0
System.RuntimeT ype.InvokeMembe r(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifi er[] modifiers, CultureInfo culture, String[] namedParameters ) +473
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String methodName, Object[] args) +58

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail .LateBoundAcces sHelper.CallMet hod(Object obj, String methodName, Object[] args) +112
System.Web.Mail .CdoSysHelper.S end(MailMessage message) +1840
System.Web.Mail .CdoSysHelper.S end(String from, String to, String subject, String messageText) +74
System.Web.Mail .SmtpMail.Send( String from, String to, String subject, String messageText) +171
Elan_Sample.Ema il_Server.Butto n1_Click(Object sender, EventArgs e) in C:\Project Files\Root\Elan _Sample\Email Server.aspx.vb: 38
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1277



ASP.NET Script :

<%@ Page Language="vb" AutoEventWireup ="false" Codebehind="Ema il Server.aspx.vb" Inherits="Elan_ Sample.Email_Se rver"%>
OCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

<title>Email_Se rver</title>

<meta name="GENERATOR " content="Micros oft Visual Studio.NET 7.0">

<meta name="CODE_LANG UAGE" content="Visual Basic 7.0">

<meta name="vs_defaul tClientScript" content="JavaSc ript">

<meta name="vs_target Schema" content="http://schemas.microso ft.com/intellisense/ie5">

</HEAD>

<body MS_POSITIONING= "GridLayout ">

<form id="Form1" method="post" runat="server">

<asp:TextBox id="txtFrom" style="Z-INDEX: 100; LEFT: 190px; POSITION: absolute; TOP: 62px" runat="server"> </asp:TextBox>

<asp:Label id="Label8" style="Z-INDEX: 113; LEFT: 99px; POSITION: absolute; TOP: 212px" runat="server" Width="68px" Height="19px">B ody</asp:Label>

<asp:Label id="Label7" style="Z-INDEX: 112; LEFT: 99px; POSITION: absolute; TOP: 156px" runat="server" Width="68px" Height="19px">S ubject</asp:Label>

<asp:Label id="Label6" style="Z-INDEX: 111; LEFT: 99px; POSITION: absolute; TOP: 109px" runat="server" Width="68" Height="19">To</asp:Label>

<asp:TextBox id="txtBody" style="Z-INDEX: 109; LEFT: 192px; POSITION: absolute; TOP: 210px" runat="server"> </asp:TextBox>

<asp:Label id="Label4" style="Z-INDEX: 102; LEFT: 126px; POSITION: absolute; TOP: 64px" runat="server"> Label</asp:Label>

<asp:TextBox id="txtSubject " style="Z-INDEX: 108; LEFT: 193px; POSITION: absolute; TOP: 157px" runat="server"> </asp:TextBox>

<asp:Label id="Label3" style="Z-INDEX: 101; LEFT: 126px; POSITION: absolute; TOP: 64px" runat="server"> Label</asp:Label>

<asp:TextBox id="txtTo" style="Z-INDEX: 107; LEFT: 192px; POSITION: absolute; TOP: 106px" runat="server"> </asp:TextBox>

<asp:Label id="Label2" style="Z-INDEX: 103; LEFT: 126px; POSITION: absolute; TOP: 64px" runat="server"> Label</asp:Label>

<asp:Label id="Label1" style="Z-INDEX: 104; LEFT: 99px; POSITION: absolute; TOP: 64px" runat="server" Width="68px" Height="19px">F orm</asp:Label>

<asp:Button id="Button1" style="Z-INDEX: 106; LEFT: 291px; POSITION: absolute; TOP: 276px" runat="server" Text="Sent" Width="65px"></asp:Button>

</form>

</body>

</HTML>

Server side Script:

Imports System.Web.Mail

Public Class Email_Server

Inherits System.Web.UI.P age

Protected WithEvents txtFrom As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label1 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Button1 As System.Web.UI.W ebControls.Butt on

Protected WithEvents Label2 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtTo As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label3 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtSubject As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label4 As System.Web.UI.W ebControls.Labe l

Protected WithEvents txtBody As System.Web.UI.W ebControls.Text Box

Protected WithEvents Label6 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Label7 As System.Web.UI.W ebControls.Labe l

Protected WithEvents Label8 As System.Web.UI.W ebControls.Labe l

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.

<System.Diagnos tics.DebuggerSt epThrough()> Private Sub InitializeCompo nent()

End Sub

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeCompo nent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load

'Put user code to initialize the page here

End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

SmtpMail.SmtpSe rver = "trainee2.c om" ' Trainee2.com is my SMTP Name

SmtpMail.Send(t xtFrom.Text, txtTo.Text, txtSubject.Text , txtBody.Text)

End Sub

End Class

--------------------------------------------------------------------------
Thanks & Regards,
ElanKathir.S.N,
ASM Technologies,
B'lore.
Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3746
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the function using a pointer to the derived class (ClassB* b; b->func(); ) the base-class function is called instead of the new function in the derived class. All other similar functions (virtual in the base class and overwritten in the the derived class) work fine, it's just this one function. ...
117
7156
by: Peter Olcott | last post by:
www.halting-problem.com
17
16351
by: Jon Slaughter | last post by:
I'm having a little trouble understanding what the slicing problem is. In B.S.'s C++ PL3rdEd he says "Becayse the Employee copy functions do not know anything about Managers, only the Employee part of Manager is copied. ".... and gives the code above as .....
0
3642
by: James Griffiths | last post by:
Here is a report I've written about a printing problem that is being experienced by a particular company for whom I had developed a A97 system. After upgrading to Win XP and AXP, some printing problems have arisen. My investigations show that it is not related to the particular system I developed. but is affecting Access in general. So, has nothing to do with reports being set to print to a default printer (which they all are) or to a...
4
1880
by: Trond Meistad | last post by:
I have a website where I run a simple asp.net web application. On Sunday night, requests to this webapplication started to time out. After much debuggeing with no result, I created a new webapplication with one aspx page that displays only a text. I uploaded this page and the dll, but requests to this page also times out. So my problem seems to be: If I request an aspx page, this request times out. The page gives no error mesage, it...
6
3794
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length is more that 1249 bytes, then the progress bar of the browser will move too slow and then displaying that the page not found!!!! If the message is less than or equal to 1249 then no problem.
5
2701
by: Dany C. | last post by:
We have install a valid SSL certificate issued to www.mycompany.com on our web server running IIS 6.0 / win2003 SP1. Then we have created a sub domain pointing to the same server for our web services at ws.mycompany.com. We have properly installed the server certificate on the client machine. When the client try to connect to our secure webservice at https:\\ws.mycompany.com we have the foolwing error: System.Net.WebException: The...
2
4543
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am doing the following:
7
1767
by: Trickynick1001 | last post by:
Hi, a newbie here. I don't have a real firm grasp on the idea of Javascript, as I'm used to programming in Qbasic and C. I'm not used to OOP. Anyway, I really don't have any idea what the problem is with this code, it just simply won't work properly. Some of the functions aren't done, but the main one gives me a Not a Number message in the text box where the calculations are supposed to come up. I tried to use a parseInt on my stuff,...
2
2700
by: tharu80 | last post by:
Hi,Im in final year student. my graduation project is making sms orders for the online shop.So i need the coding for senting the sms from the pc to mobile and receiving the sms from the mobile to pc.Please help me.
0
8432
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8428
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6753
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5962
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5456
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3919
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3964
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2442
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1548
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.