PC Review


Reply
Thread Tools Rate Thread

access denied to CDO.Message

 
 
=?Utf-8?B?UG9vamE=?=
Guest
Posts: n/a
 
      21st Feb 2005
Hi,

I have developed a windows application for our client, which informs
passengers thru email regarding a schedule change of flights. When i tested
it at my end, using their SMTP server, the mails were being sent but when
application was installed at client's place, using the same SMTP server,
mails are not being sent. I'm getting an error message -

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
(0x80040220): The "SendUsing" configuration value is invalid.


My code -

-----------------*******************--------------------------

SmtpMail.SmtpServer.Insert(0,["SMTP_Server_Name"]);
MailMessage mailMessage = new MailMessage();
mailMessage.BodyFormat = MailFormat.Html ;
mailMessage.From = fromEmailId;
mailMessage.To = toEmailId;
mailMessage.Subject = subject;
mailMessage.Body = body;

mailMessage.Headers.Add("Reply-To",reply_to);

mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60);

mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");

mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username);

mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pwd);

SmtpMail.Send(mailMessage);

-----------------*******************--------------------------

Please help me out with this. It's urgent.

Thanks and Regards,
Pooja.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmFrb2IgQ2hyaXN0ZW5zZW4=?=
Guest
Posts: n/a
 
      21st Feb 2005
Your first line of code looks weird. SmtpMail.SmtpServer is just a string so
I really do not know what you are trying to do. Your code results in an
empty string for SmtpMail.SmtpServer, so it will try to send the mail using
the local SMTP server. Change the code to:

SmtpMail.SmtpServer = smtpServerName;

HTH, Jakob.


"Pooja" wrote:

> Hi,
>
> I have developed a windows application for our client, which informs
> passengers thru email regarding a schedule change of flights. When i tested
> it at my end, using their SMTP server, the mails were being sent but when
> application was installed at client's place, using the same SMTP server,
> mails are not being sent. I'm getting an error message -
>
> 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
> (0x80040220): The "SendUsing" configuration value is invalid.
>
>
> My code -
>
> -----------------*******************--------------------------
>
> SmtpMail.SmtpServer.Insert(0,["SMTP_Server_Name"]);
> MailMessage mailMessage = new MailMessage();
> mailMessage.BodyFormat = MailFormat.Html ;
> mailMessage.From = fromEmailId;
> mailMessage.To = toEmailId;
> mailMessage.Subject = subject;
> mailMessage.Body = body;
>
> mailMessage.Headers.Add("Reply-To",reply_to);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pwd);
>
> SmtpMail.Send(mailMessage);
>
> -----------------*******************--------------------------
>
> Please help me out with this. It's urgent.
>
> Thanks and Regards,
> Pooja.

 
Reply With Quote
 
=?Utf-8?B?UG9vamE=?=
Guest
Posts: n/a
 
      21st Feb 2005
Hi,

Thanx for replying. Actually i'm reading SMTP Server Name from the
configuration settings in the first line of my code. Just changed that line
while copy pasting here. Originally it looks like -

SmtpMail.SmtpServer.Insert(0,System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_Name"]);

Please help me now.

Thanks and Regards,
Pooja.

"Jakob Christensen" wrote:

> Your first line of code looks weird. SmtpMail.SmtpServer is just a string so
> I really do not know what you are trying to do. Your code results in an
> empty string for SmtpMail.SmtpServer, so it will try to send the mail using
> the local SMTP server. Change the code to:
>
> SmtpMail.SmtpServer = smtpServerName;
>
> HTH, Jakob.
>
>
> "Pooja" wrote:
>
> > Hi,
> >
> > I have developed a windows application for our client, which informs
> > passengers thru email regarding a schedule change of flights. When i tested
> > it at my end, using their SMTP server, the mails were being sent but when
> > application was installed at client's place, using the same SMTP server,
> > mails are not being sent. I'm getting an error message -
> >
> > 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
> > (0x80040220): The "SendUsing" configuration value is invalid.
> >
> >
> > My code -
> >
> > -----------------*******************--------------------------
> >
> > SmtpMail.SmtpServer.Insert(0,["SMTP_Server_Name"]);
> > MailMessage mailMessage = new MailMessage();
> > mailMessage.BodyFormat = MailFormat.Html ;
> > mailMessage.From = fromEmailId;
> > mailMessage.To = toEmailId;
> > mailMessage.Subject = subject;
> > mailMessage.Body = body;
> >
> > mailMessage.Headers.Add("Reply-To",reply_to);
> >
> > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60);
> >
> > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
> >
> > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username);
> >
> > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pwd);
> >
> > SmtpMail.Send(mailMessage);
> >
> > -----------------*******************--------------------------
> >
> > Please help me out with this. It's urgent.
> >
> > Thanks and Regards,
> > Pooja.

 
Reply With Quote
 
=?Utf-8?B?SmFrb2IgQ2hyaXN0ZW5zZW4=?=
Guest
Posts: n/a
 
      21st Feb 2005
My point is that the following code will set SmtpMail.SmtpServer to the empty
string (hence it will use the local smtp server):

SmtpMail.SmtpServer.Insert(0,
System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_Name"]);

Instead you should use:

SmtpMail.SmtpServer =
System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_Name"];

Regards, Jakob.


"Pooja" wrote:

> Hi,
>
> Thanx for replying. Actually i'm reading SMTP Server Name from the
> configuration settings in the first line of my code. Just changed that line
> while copy pasting here. Originally it looks like -
>
> SmtpMail.SmtpServer.Insert(0,System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_Name"]);
>
> Please help me now.
>
> Thanks and Regards,
> Pooja.
>
> "Jakob Christensen" wrote:
>
> > Your first line of code looks weird. SmtpMail.SmtpServer is just a string so
> > I really do not know what you are trying to do. Your code results in an
> > empty string for SmtpMail.SmtpServer, so it will try to send the mail using
> > the local SMTP server. Change the code to:
> >
> > SmtpMail.SmtpServer = smtpServerName;
> >
> > HTH, Jakob.
> >
> >
> > "Pooja" wrote:
> >
> > > Hi,
> > >
> > > I have developed a windows application for our client, which informs
> > > passengers thru email regarding a schedule change of flights. When i tested
> > > it at my end, using their SMTP server, the mails were being sent but when
> > > application was installed at client's place, using the same SMTP server,
> > > mails are not being sent. I'm getting an error message -
> > >
> > > 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
> > > (0x80040220): The "SendUsing" configuration value is invalid.
> > >
> > >
> > > My code -
> > >
> > > -----------------*******************--------------------------
> > >
> > > SmtpMail.SmtpServer.Insert(0,["SMTP_Server_Name"]);
> > > MailMessage mailMessage = new MailMessage();
> > > mailMessage.BodyFormat = MailFormat.Html ;
> > > mailMessage.From = fromEmailId;
> > > mailMessage.To = toEmailId;
> > > mailMessage.Subject = subject;
> > > mailMessage.Body = body;
> > >
> > > mailMessage.Headers.Add("Reply-To",reply_to);
> > >
> > > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60);
> > >
> > > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
> > >
> > > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username);
> > >
> > > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pwd);
> > >
> > > SmtpMail.Send(mailMessage);
> > >
> > > -----------------*******************--------------------------
> > >
> > > Please help me out with this. It's urgent.
> > >
> > > Thanks and Regards,
> > > Pooja.

 
Reply With Quote
 
=?Utf-8?B?UG9vamE=?=
Guest
Posts: n/a
 
      21st Feb 2005
Hi,

It's still giving the same error. Do you think that on the machine from
where mail is being sent, Dafault SMTP Virtaul Server needs to be configured?

Thanks and Regards,
Pooja.

"Jakob Christensen" wrote:

> My point is that the following code will set SmtpMail.SmtpServer to the empty
> string (hence it will use the local smtp server):
>
> SmtpMail.SmtpServer.Insert(0,
> System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_Name"]);
>
> Instead you should use:
>
> SmtpMail.SmtpServer =
> System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_Name"];
>
> Regards, Jakob.
>
>
> "Pooja" wrote:
>
> > Hi,
> >
> > Thanx for replying. Actually i'm reading SMTP Server Name from the
> > configuration settings in the first line of my code. Just changed that line
> > while copy pasting here. Originally it looks like -
> >
> > SmtpMail.SmtpServer.Insert(0,System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_Name"]);
> >
> > Please help me now.
> >
> > Thanks and Regards,
> > Pooja.
> >
> > "Jakob Christensen" wrote:
> >
> > > Your first line of code looks weird. SmtpMail.SmtpServer is just a string so
> > > I really do not know what you are trying to do. Your code results in an
> > > empty string for SmtpMail.SmtpServer, so it will try to send the mail using
> > > the local SMTP server. Change the code to:
> > >
> > > SmtpMail.SmtpServer = smtpServerName;
> > >
> > > HTH, Jakob.
> > >
> > >
> > > "Pooja" wrote:
> > >
> > > > Hi,
> > > >
> > > > I have developed a windows application for our client, which informs
> > > > passengers thru email regarding a schedule change of flights. When i tested
> > > > it at my end, using their SMTP server, the mails were being sent but when
> > > > application was installed at client's place, using the same SMTP server,
> > > > mails are not being sent. I'm getting an error message -
> > > >
> > > > 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
> > > > (0x80040220): The "SendUsing" configuration value is invalid.
> > > >
> > > >
> > > > My code -
> > > >
> > > > -----------------*******************--------------------------
> > > >
> > > > SmtpMail.SmtpServer.Insert(0,["SMTP_Server_Name"]);
> > > > MailMessage mailMessage = new MailMessage();
> > > > mailMessage.BodyFormat = MailFormat.Html ;
> > > > mailMessage.From = fromEmailId;
> > > > mailMessage.To = toEmailId;
> > > > mailMessage.Subject = subject;
> > > > mailMessage.Body = body;
> > > >
> > > > mailMessage.Headers.Add("Reply-To",reply_to);
> > > >
> > > > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60);
> > > >
> > > > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
> > > >
> > > > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username);
> > > >
> > > > mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pwd);
> > > >
> > > > SmtpMail.Send(mailMessage);
> > > >
> > > > -----------------*******************--------------------------
> > > >
> > > > Please help me out with this. It's urgent.
> > > >
> > > > Thanks and Regards,
> > > > Pooja.

 
Reply With Quote
 
=?Utf-8?B?Sm/Dq2wgRGVzY29tYmVz?=
Guest
Posts: n/a
 
      21st Feb 2005
Every time I seen this message it is because the message body wasn't conform
with the SMTP specifications. Even if it doesn't seem to be that I suggest to
look around that for exemples the carriage returns...

Joel Descombes

"Pooja" wrote:

> Hi,
>
> I have developed a windows application for our client, which informs
> passengers thru email regarding a schedule change of flights. When i tested
> it at my end, using their SMTP server, the mails were being sent but when
> application was installed at client's place, using the same SMTP server,
> mails are not being sent. I'm getting an error message -
>
> 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
> (0x80040220): The "SendUsing" configuration value is invalid.
>
>
> My code -
>
> -----------------*******************--------------------------
>
> SmtpMail.SmtpServer.Insert(0,["SMTP_Server_Name"]);
> MailMessage mailMessage = new MailMessage();
> mailMessage.BodyFormat = MailFormat.Html ;
> mailMessage.From = fromEmailId;
> mailMessage.To = toEmailId;
> mailMessage.Subject = subject;
> mailMessage.Body = body;
>
> mailMessage.Headers.Add("Reply-To",reply_to);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", username);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pwd);
>
> SmtpMail.Send(mailMessage);
>
> -----------------*******************--------------------------
>
> Please help me out with this. It's urgent.
>
> Thanks and Regards,
> Pooja.

 
Reply With Quote
 
Sreejath S. Warrier
Guest
Posts: n/a
 
      21st Feb 2005
Hello Pooja,
just guessing here. I see that you are reading the SMTP Server name from
the config file.
While deploying, have you changed the server name to match the production
SMTP Server?
Regards,
Sreejath
> Hi,
>
> It's still giving the same error. Do you think that on the machine
> from where mail is being sent, Dafault SMTP Virtaul Server needs to be
> configured?
>
> Thanks and Regards,
> Pooja.
> "Jakob Christensen" wrote:
>
>> My point is that the following code will set SmtpMail.SmtpServer to
>> the empty string (hence it will use the local smtp server):
>>
>> SmtpMail.SmtpServer.Insert(0,
>> System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_N
>> ame"]);
>>
>> Instead you should use:
>>
>> SmtpMail.SmtpServer =
>> System.Configuration.ConfigurationSettings.AppSettings["SMTP_Server_N
>> ame"];
>>
>> Regards, Jakob.
>>
>> "Pooja" wrote:
>>
>>> Hi,
>>>
>>> Thanx for replying. Actually i'm reading SMTP Server Name from the
>>> configuration settings in the first line of my code. Just changed
>>> that line while copy pasting here. Originally it looks like -
>>>
>>> SmtpMail.SmtpServer.Insert(0,System.Configuration.ConfigurationSetti
>>> ngs.AppSettings["SMTP_Server_Name"]);
>>>
>>> Please help me now.
>>>
>>> Thanks and Regards,
>>> Pooja.
>>> "Jakob Christensen" wrote:
>>>
>>>> Your first line of code looks weird. SmtpMail.SmtpServer is just a
>>>> string so I really do not know what you are trying to do. Your
>>>> code results in an empty string for SmtpMail.SmtpServer, so it will
>>>> try to send the mail using the local SMTP server. Change the code
>>>> to:
>>>>
>>>> SmtpMail.SmtpServer = smtpServerName;
>>>>
>>>> HTH, Jakob.
>>>>
>>>> "Pooja" wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have developed a windows application for our client, which
>>>>> informs passengers thru email regarding a schedule change of
>>>>> flights. When i tested it at my end, using their SMTP server, the
>>>>> mails were being sent but when application was installed at
>>>>> client's place, using the same SMTP server, mails are not being
>>>>> sent. I'm getting an error message -
>>>>>
>>>>> 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 (0x80040220): The
>>>>> "SendUsing" configuration value is invalid.
>>>>>
>>>>> My code -
>>>>>
>>>>> -----------------*******************--------------------------
>>>>>
>>>>> SmtpMail.SmtpServer.Insert(0,["SMTP_Server_Name"]);
>>>>> MailMessage mailMessage = new MailMessage();
>>>>> mailMessage.BodyFormat = MailFormat.Html ;
>>>>> mailMessage.From = fromEmailId;
>>>>> mailMessage.To = toEmailId;
>>>>> mailMessage.Subject = subject;
>>>>> mailMessage.Body = body;
>>>>> mailMessage.Headers.Add("Reply-To",reply_to);
>>>>>
>>>>> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configura
>>>>> tion/smtpconnectiontimeout", 60);
>>>>>
>>>>> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configura
>>>>> tion/smtpauthenticate", "1");
>>>>>
>>>>> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configura
>>>>> tion/sendusername", username);
>>>>>
>>>>> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configura
>>>>> tion/sendpassword", pwd);
>>>>>
>>>>> SmtpMail.Send(mailMessage);
>>>>>
>>>>> -----------------*******************--------------------------
>>>>>
>>>>> Please help me out with this. It's urgent.
>>>>>
>>>>> Thanks and Regards,
>>>>> Pooja.




 
Reply With Quote
 
Carlos J. Quintero [.NET MVP]
Guest
Posts: n/a
 
      23rd Feb 2005
See the errors FAQ of http://systemwebmail.com/

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com


"Pooja" <(E-Mail Removed)> escribió en el mensaje
news:59D50EB7-EA02-4772-B3F3-(E-Mail Removed)...
> Hi,
>
> I have developed a windows application for our client, which informs
> passengers thru email regarding a schedule change of flights. When i
> tested
> it at my end, using their SMTP server, the mails were being sent but when
> application was installed at client's place, using the same SMTP server,
> mails are not being sent. I'm getting an error message -
>
> 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
> (0x80040220): The "SendUsing" configuration value is invalid.
>
>
> My code -
>
> -----------------*******************--------------------------
>
> SmtpMail.SmtpServer.Insert(0,["SMTP_Server_Name"]);
> MailMessage mailMessage = new MailMessage();
> mailMessage.BodyFormat = MailFormat.Html ;
> mailMessage.From = fromEmailId;
> mailMessage.To = toEmailId;
> mailMessage.Subject = subject;
> mailMessage.Body = body;
>
> mailMessage.Headers.Add("Reply-To",reply_to);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout",
> 60);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
> "1");
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
> username);
>
> mailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
> pwd);
>
> SmtpMail.Send(mailMessage);
>
> -----------------*******************--------------------------
>
> Please help me out with this. It's urgent.
>
> Thanks and Regards,
> Pooja.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access denied - pst message =?Utf-8?B?TmljayBLcmlsbA==?= Microsoft Outlook Contacts 2 10th Jun 2007 02:55 AM
Access is denied message when trying to access a remote printer =?Utf-8?B?TWFya0M=?= Windows Vista Print / Fax / Scan 1 9th Mar 2007 01:34 AM
Access Denied (Policy_Denied) message when try to access the inter =?Utf-8?B?c3Bhcmt5NTU=?= Windows XP General 0 30th Dec 2006 05:25 PM
Access Denied message =?Utf-8?B?T2xkLU5hdnk=?= Windows XP Help 1 9th Dec 2005 01:46 PM
Access denied? why getting this message? help =?Utf-8?B?UmV6YSBTb2xvdWtp?= Microsoft ASP .NET 1 14th Jun 2004 07:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:24 PM.