473,416 Members | 1,698 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,416 software developers and data experts.

System.Web.HttpException: Could not access 'CDO.Message' object

Hi,

I have ab ASP.Net Application in which I need to send e-mail on button
click. Even though my C# code for that is correct.I am getting the following
error:: I think the following error can be bcoz of the SMTP virtual server. I
cant view the SMTP virtual server in IIS. How to correct this error???

Send failure: System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException: Exception has been
thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x8004020F): The server rejected
one or more recipient addresses. The server response was: 550 5.7.1 Unable to
relay for ir*@trio.com --- End of inner exception stack trace --- at
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) at System.RuntimeType.InvokeMember(String name,
BindingFlags invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) --- End of inner exception stack trace --- at
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) at System.Web.Mail.CdoSysHelper.Send(MailMessage
message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at
BofLog.Details.btnMail_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\demo\boflog\details.aspx.cs:lin e 224

My code is:

private void btnMail_Click(object sender, System.EventArgs e)
{

System.Web.Mail.MailMessage objEmail = new System.Web.Mail.MailMessage();
objEmail.To = "ir*@trio.com";
objEmail.From ="ir*@trio.com";
objEmail.Subject = "New LOG";
objEmail.Body = "<h4> NEW LOG </h4>
<br><center><h3>LOG</h3></center><br> <br> <table border=1 width=80%
align=center> <tr> <td><b>Label1.Text</b></td><td>" + txtCompany.Text +"</td>
<td> </td> <td>Label2.Text</td> <td>" + txtActivationDate.Text +"</td>
<td> </td> <td>Label3.Text</td> <td>" + txtRegion.Text +"</td></tr> <tr>
<td><b>Label4.Text</b></td><td>" + txtSim.Text +"</td> <td> </td>
<td>Label5.Text</td> <td>" + txtPiae.Text +"</td> <td> </td>
<td>Label6.Text</td> <td>" + txtPiaeRepID.Text +"</td></tr> <tr>
<td><b>Label7.Text</b></td><td>" + txtDirectRep.Text +"</td> <td> </td>
<td>Label8.Text</td> <td>" + txtCompanyRepID.Text +"</td> <td> </td>
<td>Label9.Text</td> <td>" + txtChannelMgr.Text +"</td></tr> <tr>
<td><b>Label10.Text</b></td><td>" + txtSubAgent.Text +"</td> <td> </td>
<td>Label11.Text</td> <td>" + txtCustomer.Text +"</td> <td> </td>
<td>Label12.Text</td> <td>" + txtAccount.Text +"</td></tr> <tr>
<td><b>Label13.Text</b></td><td>" + txtUser.Text +"</td> <td> </td>
<td>Label14.Text</td> <td>" + rblProvision.SelectedValue +"</td> <td> </td>
<td>Label15.Text</td> <td>" + txtMrc.Text +"</td></tr> <tr>
<td><b>Label16.Text</b></td><td>" + txtp2kOrder.Text +"</td> <td> </td>
<td>Label17.Text</td> <td>" + txtMin.Text +"</td> <td> </td>
<td>Label18.Text</td> <td>" + txtAsiOrder.Text +"</td></tr> <tr>
<td><b>Label19.Text</b></td><td>" + txtTracking.Text +"</td> <td> </td>
<td>Label20.Text</td> <td>" + txtEsn.Text +"</td> <td> </td>
<td>Label21.Text</td> <td>" + txtVerified.Text +"</td></tr> <tr>
<td>Label22.Text</td> <td>" + txtCustServiceRep.Text +"</td></tr></table>";
objEmail.Priority = System.Web.Mail.MailPriority.High;

objEmail.BodyFormat = System.Web.Mail.MailFormat.Html;
System.Web.Mail.SmtpMail.SmtpServer= "localhost";
try
{
System.Web.Mail.SmtpMail.Send(objEmail);
Response.Redirect("WebForm2.aspx");
}
catch (Exception exc)
{
Response.Write("Send failure: " + exc.ToString());
}
}

pmud
Nov 19 '05 #1
3 4321
Hi PMUD

If you use the local smtp don't make a roundtrip thru the network - use the
pickup dir

MailMessage.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"]
= 1;
MailMessage.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"]
= ((_"C:\\Inetpub\\mailroot\\Pickup";

--
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
"pmud" <pm**@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
Hi,

I have ab ASP.Net Application in which I need to send e-mail on button
click. Even though my C# code for that is correct.I am getting the
following
error:: I think the following error can be bcoz of the SMTP virtual
server. I
cant view the SMTP virtual server in IIS. How to correct this error???

Send failure: System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException: Exception has
been
thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x8004020F): The server
rejected
one or more recipient addresses. The server response was: 550 5.7.1 Unable
to
relay for ir*@trio.com --- End of inner exception stack trace --- at
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) at System.RuntimeType.InvokeMember(String name,
BindingFlags invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) --- End of inner exception stack trace --- at
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) at
System.Web.Mail.CdoSysHelper.Send(MailMessage
message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at
BofLog.Details.btnMail_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\demo\boflog\details.aspx.cs:lin e 224

My code is:

private void btnMail_Click(object sender, System.EventArgs e)
{

System.Web.Mail.MailMessage objEmail = new System.Web.Mail.MailMessage();
objEmail.To = "ir*@trio.com";
objEmail.From ="ir*@trio.com";
objEmail.Subject = "New LOG";
objEmail.Body = "<h4> NEW LOG </h4>
<br><center><h3>LOG</h3></center><br> <br> <table border=1 width=80%
align=center> <tr> <td><b>Label1.Text</b></td><td>" + txtCompany.Text
+"</td>
<td> </td> <td>Label2.Text</td> <td>" + txtActivationDate.Text +"</td>
<td> </td> <td>Label3.Text</td> <td>" + txtRegion.Text +"</td></tr> <tr>
<td><b>Label4.Text</b></td><td>" + txtSim.Text +"</td> <td> </td>
<td>Label5.Text</td> <td>" + txtPiae.Text +"</td> <td> </td>
<td>Label6.Text</td> <td>" + txtPiaeRepID.Text +"</td></tr> <tr>
<td><b>Label7.Text</b></td><td>" + txtDirectRep.Text +"</td> <td> </td>
<td>Label8.Text</td> <td>" + txtCompanyRepID.Text +"</td> <td> </td>
<td>Label9.Text</td> <td>" + txtChannelMgr.Text +"</td></tr> <tr>
<td><b>Label10.Text</b></td><td>" + txtSubAgent.Text +"</td> <td> </td>
<td>Label11.Text</td> <td>" + txtCustomer.Text +"</td> <td> </td>
<td>Label12.Text</td> <td>" + txtAccount.Text +"</td></tr> <tr>
<td><b>Label13.Text</b></td><td>" + txtUser.Text +"</td> <td> </td>
<td>Label14.Text</td> <td>" + rblProvision.SelectedValue +"</td> <td>
</td>
<td>Label15.Text</td> <td>" + txtMrc.Text +"</td></tr> <tr>
<td><b>Label16.Text</b></td><td>" + txtp2kOrder.Text +"</td> <td> </td>
<td>Label17.Text</td> <td>" + txtMin.Text +"</td> <td> </td>
<td>Label18.Text</td> <td>" + txtAsiOrder.Text +"</td></tr> <tr>
<td><b>Label19.Text</b></td><td>" + txtTracking.Text +"</td> <td> </td>
<td>Label20.Text</td> <td>" + txtEsn.Text +"</td> <td> </td>
<td>Label21.Text</td> <td>" + txtVerified.Text +"</td></tr> <tr>
<td>Label22.Text</td> <td>" + txtCustServiceRep.Text
+"</td></tr></table>";
objEmail.Priority = System.Web.Mail.MailPriority.High;

objEmail.BodyFormat = System.Web.Mail.MailFormat.Html;
System.Web.Mail.SmtpMail.SmtpServer= "localhost";
try
{
System.Web.Mail.SmtpMail.Send(objEmail);
Response.Redirect("WebForm2.aspx");
}
catch (Exception exc)
{
Response.Write("Send failure: " + exc.ToString());
}
}

pmud

Nov 19 '05 #2
Both the links you gave me are not working. Can you please suggest smthg else?

thanks

"Daniel Fisher(lennybacon)" wrote:
Hi PMUD

If you use the local smtp don't make a roundtrip thru the network - use the
pickup dir

MailMessage.Fields["http://schemas.microsoft.com/cdo/configuration/sendusing"]
= 1;
MailMessage.Fields["http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory"]
= ((_"C:\\Inetpub\\mailroot\\Pickup";

--
Daniel Fisher(lennybacon)
MCP ASP.NET C#
Blog: http://www.lennybacon.com/
"pmud" <pm**@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
Hi,

I have ab ASP.Net Application in which I need to send e-mail on button
click. Even though my C# code for that is correct.I am getting the
following
error:: I think the following error can be bcoz of the SMTP virtual
server. I
cant view the SMTP virtual server in IIS. How to correct this error???

Send failure: System.Web.HttpException: Could not access 'CDO.Message'
object. ---> System.Reflection.TargetInvocationException: Exception has
been
thrown by the target of an invocation. --->
System.Runtime.InteropServices.COMException (0x8004020F): The server
rejected
one or more recipient addresses. The server response was: 550 5.7.1 Unable
to
relay for ir*@trio.com --- End of inner exception stack trace --- at
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) at System.RuntimeType.InvokeMember(String name,
BindingFlags invokeAttr, Binder binder, Object target, Object[] args,
ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters)
at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) --- End of inner exception stack trace --- at
System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
methodName, Object[] args) at
System.Web.Mail.CdoSysHelper.Send(MailMessage
message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at
BofLog.Details.btnMail_Click(Object sender, EventArgs e) in
c:\inetpub\wwwroot\demo\boflog\details.aspx.cs:lin e 224

My code is:

private void btnMail_Click(object sender, System.EventArgs e)
{

System.Web.Mail.MailMessage objEmail = new System.Web.Mail.MailMessage();
objEmail.To = "ir*@trio.com";
objEmail.From ="ir*@trio.com";
objEmail.Subject = "New LOG";
objEmail.Body = "<h4> NEW LOG </h4>
<br><center><h3>LOG</h3></center><br> <br> <table border=1 width=80%
align=center> <tr> <td><b>Label1.Text</b></td><td>" + txtCompany.Text
+"</td>
<td> </td> <td>Label2.Text</td> <td>" + txtActivationDate.Text +"</td>
<td> </td> <td>Label3.Text</td> <td>" + txtRegion.Text +"</td></tr> <tr>
<td><b>Label4.Text</b></td><td>" + txtSim.Text +"</td> <td> </td>
<td>Label5.Text</td> <td>" + txtPiae.Text +"</td> <td> </td>
<td>Label6.Text</td> <td>" + txtPiaeRepID.Text +"</td></tr> <tr>
<td><b>Label7.Text</b></td><td>" + txtDirectRep.Text +"</td> <td> </td>
<td>Label8.Text</td> <td>" + txtCompanyRepID.Text +"</td> <td> </td>
<td>Label9.Text</td> <td>" + txtChannelMgr.Text +"</td></tr> <tr>
<td><b>Label10.Text</b></td><td>" + txtSubAgent.Text +"</td> <td> </td>
<td>Label11.Text</td> <td>" + txtCustomer.Text +"</td> <td> </td>
<td>Label12.Text</td> <td>" + txtAccount.Text +"</td></tr> <tr>
<td><b>Label13.Text</b></td><td>" + txtUser.Text +"</td> <td> </td>
<td>Label14.Text</td> <td>" + rblProvision.SelectedValue +"</td> <td>
</td>
<td>Label15.Text</td> <td>" + txtMrc.Text +"</td></tr> <tr>
<td><b>Label16.Text</b></td><td>" + txtp2kOrder.Text +"</td> <td> </td>
<td>Label17.Text</td> <td>" + txtMin.Text +"</td> <td> </td>
<td>Label18.Text</td> <td>" + txtAsiOrder.Text +"</td></tr> <tr>
<td><b>Label19.Text</b></td><td>" + txtTracking.Text +"</td> <td> </td>
<td>Label20.Text</td> <td>" + txtEsn.Text +"</td> <td> </td>
<td>Label21.Text</td> <td>" + txtVerified.Text +"</td></tr> <tr>
<td>Label22.Text</td> <td>" + txtCustServiceRep.Text
+"</td></tr></table>";
objEmail.Priority = System.Web.Mail.MailPriority.High;

objEmail.BodyFormat = System.Web.Mail.MailFormat.Html;
System.Web.Mail.SmtpMail.SmtpServer= "localhost";
try
{
System.Web.Mail.SmtpMail.Send(objEmail);
Response.Redirect("WebForm2.aspx");
}
catch (Exception exc)
{
Response.Write("Send failure: " + exc.ToString());
}
}

pmud


Nov 19 '05 #3
the message means that the smtp server is unable to relay the message, it
should be in the dead letter folder. you will need to configure the virtual
smtp server to be able to talk to a functioning smtp server. find the setup
info for the smtp server you want the virtual one to relay to, then confire
the smtp server in iis manager
-- bruce (sqlwork.com)


"pmud" <pm**@discussions.microsoft.com> wrote in message
news:EB**********************************@microsof t.com...
| Hi,
|
| I have ab ASP.Net Application in which I need to send e-mail on button
| click. Even though my C# code for that is correct.I am getting the
following
| error:: I think the following error can be bcoz of the SMTP virtual
server. I
| cant view the SMTP virtual server in IIS. How to correct this error???
|
| Send failure: System.Web.HttpException: Could not access 'CDO.Message'
| object. ---> System.Reflection.TargetInvocationException: Exception has
been
| thrown by the target of an invocation. --->
| System.Runtime.InteropServices.COMException (0x8004020F): The server
rejected
| one or more recipient addresses. The server response was: 550 5.7.1 Unable
to
| relay for ir*@trio.com --- End of inner exception stack trace --- at
| System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
| Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
| String[] namedParameters) at System.RuntimeType.InvokeMember(String name,
| BindingFlags invokeAttr, Binder binder, Object target, Object[] args,
| ParameterModifier[] modifiers, CultureInfo culture, String[]
namedParameters)
| at System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
| methodName, Object[] args) --- End of inner exception stack trace --- at
| System.Web.Mail.LateBoundAccessHelper.CallMethod(O bject obj, String
| methodName, Object[] args) at
System.Web.Mail.CdoSysHelper.Send(MailMessage
| message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at
| BofLog.Details.btnMail_Click(Object sender, EventArgs e) in
| c:\inetpub\wwwroot\demo\boflog\details.aspx.cs:lin e 224
|
| My code is:
|
| private void btnMail_Click(object sender, System.EventArgs e)
| {
|
| System.Web.Mail.MailMessage objEmail = new System.Web.Mail.MailMessage();
| objEmail.To = "ir*@trio.com";
| objEmail.From ="ir*@trio.com";
| objEmail.Subject = "New LOG";
| objEmail.Body = "<h4> NEW LOG </h4>
| <br><center><h3>LOG</h3></center><br> <br> <table border=1 width=80%
| align=center> <tr> <td><b>Label1.Text</b></td><td>" + txtCompany.Text
+"</td>
| <td> </td> <td>Label2.Text</td> <td>" + txtActivationDate.Text +"</td>
| <td> </td> <td>Label3.Text</td> <td>" + txtRegion.Text +"</td></tr> <tr>
| <td><b>Label4.Text</b></td><td>" + txtSim.Text +"</td> <td> </td>
| <td>Label5.Text</td> <td>" + txtPiae.Text +"</td> <td> </td>
| <td>Label6.Text</td> <td>" + txtPiaeRepID.Text +"</td></tr> <tr>
| <td><b>Label7.Text</b></td><td>" + txtDirectRep.Text +"</td> <td> </td>
| <td>Label8.Text</td> <td>" + txtCompanyRepID.Text +"</td> <td> </td>
| <td>Label9.Text</td> <td>" + txtChannelMgr.Text +"</td></tr> <tr>
| <td><b>Label10.Text</b></td><td>" + txtSubAgent.Text +"</td> <td> </td>
| <td>Label11.Text</td> <td>" + txtCustomer.Text +"</td> <td> </td>
| <td>Label12.Text</td> <td>" + txtAccount.Text +"</td></tr> <tr>
| <td><b>Label13.Text</b></td><td>" + txtUser.Text +"</td> <td> </td>
| <td>Label14.Text</td> <td>" + rblProvision.SelectedValue +"</td> <td>
</td>
| <td>Label15.Text</td> <td>" + txtMrc.Text +"</td></tr> <tr>
| <td><b>Label16.Text</b></td><td>" + txtp2kOrder.Text +"</td> <td> </td>
| <td>Label17.Text</td> <td>" + txtMin.Text +"</td> <td> </td>
| <td>Label18.Text</td> <td>" + txtAsiOrder.Text +"</td></tr> <tr>
| <td><b>Label19.Text</b></td><td>" + txtTracking.Text +"</td> <td> </td>
| <td>Label20.Text</td> <td>" + txtEsn.Text +"</td> <td> </td>
| <td>Label21.Text</td> <td>" + txtVerified.Text +"</td></tr> <tr>
| <td>Label22.Text</td> <td>" + txtCustServiceRep.Text
+"</td></tr></table>";
| objEmail.Priority = System.Web.Mail.MailPriority.High;
|
| objEmail.BodyFormat = System.Web.Mail.MailFormat.Html;
| System.Web.Mail.SmtpMail.SmtpServer= "localhost";
| try
| {
| System.Web.Mail.SmtpMail.Send(objEmail);
| Response.Redirect("WebForm2.aspx");
| }
| catch (Exception exc)
| {
| Response.Write("Send failure: " + exc.ToString());
| }
| }
|
| pmud
Nov 19 '05 #4

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

Similar topics

5
by: ES | last post by:
Hello, I have very simple console app that attempts to send an email using system.web.mail. I compiles and runs without any errors but doesn't send anything. I've checked the badmail folder,...
3
by: Bryan Martin | last post by:
I have a program which has ran every night fine until last night. Now it bombs with the following errors. I have also broke this down to its simplest form for sending the mail...
3
by: Roger | last post by:
Using the objects in System.Web, I am able to send email to internal email address using VB or C#.net. But,if I try to send an email to an external email address, I receive this message: An...
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...
4
by: SJR3t2 | last post by:
I have re-installed .NET 1.1 and SP1 on multiple computers, one with Win XP Pro and another with Win 2003, and I can't seem to get the System.Web.Mail namespace and SmptMail and MailMessage...
12
by: Ricky | last post by:
I am using the System.web.mail component in my application being developed in VB.NET 1) Does sending email using System.web.mail work/run only on WinNT,2000 and XP Operating systems. 2) Does...
8
by: marcmc | last post by:
Trying to send an eMail frommy vb.net App. Is there anybody out there that has successfully done this? I am having major problems and need a step by step guide into the world of system.web and...
2
by: Husam | last post by:
Hi EveryBody: I made windows application project as e-mail sender. This project consist of 13 textbox and one label and one button. I add {system.web.dll} as refrance to this project to help me...
2
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...
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.