B
Brian Morris
I'm new to .NET and just trying a few things out, like emailing. I created a
form in Visual Studio .Net to input some information for generating an email
and I'm getting the following error when it executes both on my server or on
the server of the .NET service provider. I'm obviously missing something
very basic and I'm hoping one of you can point out my error. Thank you for
your assistance.
Brian
**** ERROR MESSAGE ****
The "SendUsing" configuration value is invalid.
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
"SendUsing" configuration value is invalid.
Source Error:
Line 54: "Order Details" & OrderDetails.Text
Line 55:
Line 56: System.Web.Mail.SmtpMail.Send(EmailFrom, EmailTo, EmailSubject,
EmailBody)
Line 57:
Line 58: End Sub
Source File: c:\inetpub\wwwroot\Email User Control\EmailWebForm.aspx.vb
Line: 56
***** END OF ERROR MESSAGE WITH THE STACK TRACE OMITTED - I CAN SUPPLY THIS
IF REQUIRED *****
***** THIS IS THE VB.NET CODE BEHIND FORM *****
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents ClientName As System.Web.UI.WebControls.TextBox
Protected WithEvents EmailAddress As System.Web.UI.WebControls.TextBox
Protected WithEvents OrderDetails As System.Web.UI.WebControls.TextBox
Protected WithEvents NameLabel As System.Web.UI.WebControls.Label
Protected WithEvents OrderDescriptionLabel As
System.Web.UI.WebControls.Label
Protected WithEvents PostalCodeText As System.Web.UI.WebControls.TextBox
Protected WithEvents MailingAddressTextBox As
System.Web.UI.WebControls.TextBox
Protected WithEvents MailingAddrLabel As System.Web.UI.WebControls.Label
Protected WithEvents PhoneNbr As System.Web.UI.WebControls.TextBox
Protected WithEvents EmailAddrLabel As System.Web.UI.WebControls.Label
Protected WithEvents PhoneNbrLabel As System.Web.UI.WebControls.Label
Protected WithEvents ProvinceStateText As System.Web.UI.WebControls.TextBox
Protected WithEvents PostalCodeLabel As System.Web.UI.WebControls.Label
Protected WithEvents ProvinceStateLabel As System.Web.UI.WebControls.Label
Protected WithEvents CancelButton As System.Web.UI.WebControls.Button
Protected WithEvents SubmitButton As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub SubmitButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles SubmitButton.Click
Dim EmailTo As String
Dim EmailFrom As String
Dim EmailSubject As String
Dim EmailBody As String
EmailTo = "(e-mail address removed)"
EmailFrom = EmailAddress.Text
EmailSubject = "Website Email Order"
EmailBody = "Name: " & ClientName.Text & _
"Phone Number: " & PhoneNbr.Text & _
"Mailing Address: " & MailingAddressTextBox.Text & _
"Province / State: " & ProvinceStateText.Text & _
"Postal Code: " & PostalCodeText.Text & _
"Order Details" & OrderDetails.Text
System.Web.Mail.SmtpMail.Send(EmailFrom, EmailTo, EmailSubject, EmailBody)
End Sub
Private Sub CancelButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CancelButton.Click
EmailAddress.Text = ""
ClientName.Text = ""
PhoneNbr.Text = ""
MailingAddressTextBox.Text = ""
ProvinceStateText.Text = ""
PostalCodeText.Text = ""
OrderDetails.Text = "Enter Your Order Details Again"
End Sub
End Class
form in Visual Studio .Net to input some information for generating an email
and I'm getting the following error when it executes both on my server or on
the server of the .NET service provider. I'm obviously missing something
very basic and I'm hoping one of you can point out my error. Thank you for
your assistance.
Brian
**** ERROR MESSAGE ****
The "SendUsing" configuration value is invalid.
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
"SendUsing" configuration value is invalid.
Source Error:
Line 54: "Order Details" & OrderDetails.Text
Line 55:
Line 56: System.Web.Mail.SmtpMail.Send(EmailFrom, EmailTo, EmailSubject,
EmailBody)
Line 57:
Line 58: End Sub
Source File: c:\inetpub\wwwroot\Email User Control\EmailWebForm.aspx.vb
Line: 56
***** END OF ERROR MESSAGE WITH THE STACK TRACE OMITTED - I CAN SUPPLY THIS
IF REQUIRED *****
***** THIS IS THE VB.NET CODE BEHIND FORM *****
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents ClientName As System.Web.UI.WebControls.TextBox
Protected WithEvents EmailAddress As System.Web.UI.WebControls.TextBox
Protected WithEvents OrderDetails As System.Web.UI.WebControls.TextBox
Protected WithEvents NameLabel As System.Web.UI.WebControls.Label
Protected WithEvents OrderDescriptionLabel As
System.Web.UI.WebControls.Label
Protected WithEvents PostalCodeText As System.Web.UI.WebControls.TextBox
Protected WithEvents MailingAddressTextBox As
System.Web.UI.WebControls.TextBox
Protected WithEvents MailingAddrLabel As System.Web.UI.WebControls.Label
Protected WithEvents PhoneNbr As System.Web.UI.WebControls.TextBox
Protected WithEvents EmailAddrLabel As System.Web.UI.WebControls.Label
Protected WithEvents PhoneNbrLabel As System.Web.UI.WebControls.Label
Protected WithEvents ProvinceStateText As System.Web.UI.WebControls.TextBox
Protected WithEvents PostalCodeLabel As System.Web.UI.WebControls.Label
Protected WithEvents ProvinceStateLabel As System.Web.UI.WebControls.Label
Protected WithEvents CancelButton As System.Web.UI.WebControls.Button
Protected WithEvents SubmitButton As System.Web.UI.WebControls.Button
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
End Sub
Private Sub SubmitButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles SubmitButton.Click
Dim EmailTo As String
Dim EmailFrom As String
Dim EmailSubject As String
Dim EmailBody As String
EmailTo = "(e-mail address removed)"
EmailFrom = EmailAddress.Text
EmailSubject = "Website Email Order"
EmailBody = "Name: " & ClientName.Text & _
"Phone Number: " & PhoneNbr.Text & _
"Mailing Address: " & MailingAddressTextBox.Text & _
"Province / State: " & ProvinceStateText.Text & _
"Postal Code: " & PostalCodeText.Text & _
"Order Details" & OrderDetails.Text
System.Web.Mail.SmtpMail.Send(EmailFrom, EmailTo, EmailSubject, EmailBody)
End Sub
Private Sub CancelButton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles CancelButton.Click
EmailAddress.Text = ""
ClientName.Text = ""
PhoneNbr.Text = ""
MailingAddressTextBox.Text = ""
ProvinceStateText.Text = ""
PostalCodeText.Text = ""
OrderDetails.Text = "Enter Your Order Details Again"
End Sub
End Class