Error sending an email from the server side

N

Nader

Hello all,

Any help would be greatly appreciated.

In a Web-based application (server is local) I am trying to send an email
from the server side by

The error occurs at the following line while trying to send an email from
the server:
SmtpMail.Send(msgMail);
msgMail is of type MailMessage and contains 'From', 'To', 'Subject' and
'Body' fields...

Here is the 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(Type type, Object obj,
String methodName, Object[] args)
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
System.Web.Mail.SmtpMail.Send(MailMessage message)
AdvancedFeatures.Mail.butSend_Click(Object sender, EventArgs e) in
c:\mcadwebapps\chapter07\advancedfeatures\mail.aspx.cs:88
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1263
 
I

Ignacio Machin

Hi Nader,

Did you especify your SMTP server:
SmtpMail.SmtpServer = smtpserver;

SmtpMail.Send(message);


Hope this help,
 
N

Nader

Thanks a lot. Now I set it to my local machine name and it looks better but
I have another error:

The server rejected one or more recipient addresses. The server response
was: 550 5.7.1 Unable to relay for destinationEmailAddress


Ignacio Machin said:
Hi Nader,

Did you especify your SMTP server:
SmtpMail.SmtpServer = smtpserver;

SmtpMail.Send(message);


Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Nader said:
Hello all,

Any help would be greatly appreciated.

In a Web-based application (server is local) I am trying to send an email
from the server side by

The error occurs at the following line while trying to send an email from
the server:
SmtpMail.Send(msgMail);
msgMail is of type MailMessage and contains 'From', 'To', 'Subject' and
'Body' fields...

Here is the 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(Type type, Object obj,
String methodName, Object[] args)
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
System.Web.Mail.SmtpMail.Send(MailMessage message)
AdvancedFeatures.Mail.butSend_Click(Object sender, EventArgs e) in
c:\mcadwebapps\chapter07\advancedfeatures\mail.aspx.cs:88
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1263
 
N

Nader

Thanks a lot Ignacio. FIXED.

Ignacio Machin said:
Hi Nader,

Did you especify your SMTP server:
SmtpMail.SmtpServer = smtpserver;

SmtpMail.Send(message);


Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Nader said:
Hello all,

Any help would be greatly appreciated.

In a Web-based application (server is local) I am trying to send an email
from the server side by

The error occurs at the following line while trying to send an email from
the server:
SmtpMail.Send(msgMail);
msgMail is of type MailMessage and contains 'From', 'To', 'Subject' and
'Body' fields...

Here is the 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(Type type, Object obj,
String methodName, Object[] args)
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)

[HttpException (0x80004005): Could not access 'CDO.Message' object.]
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args)
System.Web.Mail.CdoSysHelper.Send(MailMessage message)
System.Web.Mail.SmtpMail.Send(MailMessage message)
AdvancedFeatures.Mail.butSend_Click(Object sender, EventArgs e) in
c:\mcadwebapps\chapter07\advancedfeatures\mail.aspx.cs:88
System.Web.UI.WebControls.Button.OnClick(EventArgs e)
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain() +1263
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top