|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
access denied to CDO.MessageI 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. 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. Show quoteHide quote "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. 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. Show quoteHide quote "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. 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. Show quoteHide quote "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. 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. Show quoteHide quote "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. 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 Show quoteHide quote > 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. 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 Show quoteHide quote "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. See the errors FAQ of http://systemwebmail.com/
-- Show quoteHide quoteCarlos 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" <Po***@discussions.microsoft.com> escribió en el mensaje news:59D50EB7-EA02-4772-B3F3-B8CD849BBC1B@microsoft.com... > 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.
Other interesting topics
strong naming fails if delay signed
When does a Windows Form create it's message processing thread CLR Bug ?! GUID for .Net framework GenericPrincipal serialization. Encryption algorithms for product licensing Release date for .NET 2.0 Book recomendation Application.Run Including MSDE in Windows package, containing C# app |
|||||||||||||||||||||||