473,418 Members | 2,040 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

"SendUsing" configuration value is invalid.

Hi
I had used following code for sending e-mail but facing this problem.
I want to send this e-mail in ASP.NET using VB.NET code. I am
attaching both code an output.

CODE

Imports System.Web.HttpCookie
Imports System.Web.Mail
Imports System.Web.Mail.SmtpMail
Imports System.Web.HttpCookieCollection
Imports System.IO
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 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
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim mycookie As New HttpCookie("canada bank", "Your
transaction is completed successfully.")
'mycookie.Expires = System.Convert.ToDateTime(2)
Response.Cookies.Add(mycookie)
Dim msg As New MailMessage()
Dim strwriter As New StringWriter()
Dim txt As New HtmlTextWriter(strwriter)
txt.RenderBeginTag("head")
txt.RenderBeginTag("title")
txt.Write("thank you!")
txt.RenderEndTag()
txt.RenderBeginTag("body")
txt.WriteLine("thank you for transaction through canda bank!")
txt.RenderEndTag()
txt.RenderEndTag()
msg.From = "canada bank.com"
msg.To = TextBox1.Text
msg.Subject = "thank you for registering"
msg.Body = strwriter.ToString
msg.BodyFormat = MailFormat.Html
SmtpMail.Send(msg)
End Sub
End Class

OUTPUT

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

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 48: msg.Body = strwriter.ToString
Line 49: msg.BodyFormat = MailFormat.Html
Line 50: SmtpMail.Send(msg)
Line 51: End Sub
Line 52: End Class
Source File: C:\Inetpub\wwwroot\WebApplication15\WebForm1.aspx. vb
Line: 50

Stack Trace:
[COMException (0x80040220): The "SendUsing" configuration value is
invalid.
]

[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)
WebApplication15.WebForm1.Button1_Click(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\WebApplication15\WebForm1.aspx. vb:50
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0;
ASP.NET Version:1.0.3705.0

Apr 18 '07 #1
1 6697
Specify the smtp server address.

"sa************@gmail.com" wrote:
Hi
I had used following code for sending e-mail but facing this problem.
I want to send this e-mail in ASP.NET using VB.NET code. I am
attaching both code an output.

CODE

Imports System.Web.HttpCookie
Imports System.Web.Mail
Imports System.Web.Mail.SmtpMail
Imports System.Web.HttpCookieCollection
Imports System.IO
Public Class WebForm1
Inherits System.Web.UI.Page
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Button1 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
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim mycookie As New HttpCookie("canada bank", "Your
transaction is completed successfully.")
'mycookie.Expires = System.Convert.ToDateTime(2)
Response.Cookies.Add(mycookie)
Dim msg As New MailMessage()
Dim strwriter As New StringWriter()
Dim txt As New HtmlTextWriter(strwriter)
txt.RenderBeginTag("head")
txt.RenderBeginTag("title")
txt.Write("thank you!")
txt.RenderEndTag()
txt.RenderBeginTag("body")
txt.WriteLine("thank you for transaction through canda bank!")
txt.RenderEndTag()
txt.RenderEndTag()
msg.From = "canada bank.com"
msg.To = TextBox1.Text
msg.Subject = "thank you for registering"
msg.Body = strwriter.ToString
msg.BodyFormat = MailFormat.Html
SmtpMail.Send(msg)
End Sub
End Class

OUTPUT

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

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 48: msg.Body = strwriter.ToString
Line 49: msg.BodyFormat = MailFormat.Html
Line 50: SmtpMail.Send(msg)
Line 51: End Sub
Line 52: End Class
Source File: C:\Inetpub\wwwroot\WebApplication15\WebForm1.aspx. vb
Line: 50

Stack Trace:
[COMException (0x80040220): The "SendUsing" configuration value is
invalid.
]

[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)
WebApplication15.WebForm1.Button1_Click(Object sender, EventArgs e)
in C:\Inetpub\wwwroot\WebApplication15\WebForm1.aspx. vb:50
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.0.3705.0;
ASP.NET Version:1.0.3705.0

Apr 18 '07 #2

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

Similar topics

0
by: Brian Morris | last post by:
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...
1
by: CK | last post by:
Hi All, I have this problem when try to send a mail by Using CDO.Message. I got the info from the web, said it may the problem where, the IIS SMTP setup incorrectly. My question is How i can know...
2
by: Brent | last post by:
Hi, I have a C# asp.net app that sent mail fine on server 2000 or win 2000, but now I moved it to our new 2003 box, and it's giving me "The 'SendUsing' configuration is invalid" This is the code...
1
by: Elie | last post by:
Hello I get this error when the code runs from the server as an .asp page or from a compiled dll. But When I log onto the server and run a vb program that executes the same code, it works...
5
by: lds | last post by:
I am getting the following error: The "SendUsing" configuration value is invalid. Description: An unhandled exception occurred during the execution of the current web request. Please review the...
1
by: Benny Ng | last post by:
Dear All, Now I just finished my winform application. And a part of that is to send email reminder to the users. It's working fine in the server that with SMTP service in Windows 2003. But now...
1
by: groupie | last post by:
Hi, I'd like to know how to implement the "Forgot Password" feature on many websites which require a login, exactly like this ebay example:...
8
by: kpdeepu | last post by:
Hi all, I am a complete newbie to ASP and am trying to send email from my gmail account to another gmail ID. Is it possible? I have my computer with no mail server installed. i have IIS installed...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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...

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.