Sponsored by
www.aspnetemail.com
|
 |
Discuss This FAQ Item
Got a question? Another Suggestion? Want to post your solution? Discuss it below.
-
"Could not access 'CDO.Message' Object - Part 6
[ Reply ]
The solution to this problem in my case was to set smtpmail.smtpserver to the public IP address of the server - NOT 127.0.0.1. I had relaying set up for both the public IP address and the localhost IP address, but even with the relay settings allowing 127.0.0.1, up until smtpmail.smtpserver was set to the public IP address (64.xxx.xxx.xx) it didn't work (neither did "localhost").
Andrew [ dotnetdesign ( at ) yahoo dot com ],
2004-03-17 17:35:08
#
-
4.2.7 "Could not access 'CDO.Message' Object - Part 6
[ Reply ]
I deployed a .Net solution with SendMail capability, and it works fine on my own computer but not on the unattented client machines.
I'm using a central Exchange server as SMTP Mailserver.
I get the "Could not access 'CDO.Message' Object" and find out that the simple answer is that the SMTP Service from the Add/Remove Windows Components should be activated, never the less I using the Exchange server as host.
This helped for me.
Jan Borup Coyle [ jb ( at ) xess dot dk ],
2004-05-03 01:02:09
#
-
AccessDenied on CodeBehind Page
[ Reply ]
I have an ASP.NET page that performs some actions on PageLoad and, if successfull, send an email message.
After following some of the suggestions on your excellent web site, I was able to get the SmtpMail.Send method to work.
However, I then moved the PageLoad subroutine to a code behind page, which I compiled into an DLL in the application's BIN directory. Now I get a new exception from the SmtpMail.Send event - everything else on the page works up to that point. The full exception text is:
Could not access 'CDO.Message' object. Inner Exception Information: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.UnauthorizedAccessException: Access is denied.
--- 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(Object obj, String methodName, Object[] args) Inner Exception Information: System.UnauthorizedAccessException: Access is denied.
Any idea why moving the subroutine to a codebehind page would trigger this exception?
Mike Renda [ michael dot renda ( at ) info-resonance dot com ],
2004-05-22 09:25:06
#
-
RE: AccessDenied on CodeBehind Page
[ Reply ]
I am having a very similar problem. Were you ever able to solve this? I would appreciate any help. If I find something, I'll let you know as well.
Adam Blevins [ ablevins ( at ) kcc dot com ],
2005-05-27 13:05:07
#
-
The pickup directory path is required and was not specified
[ Reply ]
I am getting a "The pickup directory path is required and was not specified" error while attempting to send a mail
the application is using,
MailMessage message = new MailMessage();
//Set the UserId message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "XXX"); //Password message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", ""); //SMTP PortNo message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "25"); //Authentication Type message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1); message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing",1) ; message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60);
SmtpMail.SmtpServer = "XXX";
//Set all other required Parameter of email. message.To = "XXX"; message.From = "XXX"; message.Subject = "Test Mail"; message.Body = "This is a test mail";
SmtpMail.Send(message);
Does anybody know possible reasons ?
Thanks in advance
net user [ arun ( at ) setuindia dot com ],
2005-02-18 05:09:45
#
-
class not registered
[ Reply ]
Hi all, I am getting a error as class not registered when I try to send a e-mail from VB.Net. I think it is also looking for cdoex.dll under MAPI folder under microsoft shared folder. I try to copy some other machine cdosys.dll file to run it, & try to register the cdosys.dll but it fails
error message is given bellows:
Class not registered 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: Class not registered
Source Error:
Line 498: 'msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60); Line 499: Line 500: System.Web.Mail.SmtpMail.Send(mailmsg) Line 501: 'Catch ex As Exception Line 502:
Source File: C:\Documents and Settings\ab8392\Desktop\DotNet\test1\TestCasesReqRev.aspx.vb Line: 500
Stack Trace:
[COMException (0x80040154): Class not registered ]
[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) test1.WebForm1.sendmail_newRel() in C:\Documents and Settings\ab8392\Desktop\DotNet\test1\TestCasesReqRev.aspx.vb:500 test1.WebForm1.verifyduplicate() in C:\Documents and Settings\ab8392\Desktop\DotNet\test1\TestCasesReqRev.aspx.vb:302 test1.WebForm1.btnsave_Click(Object sender, EventArgs e) in C:\Documents and Settings\ab8392\Desktop\DotNet\test1\TestCasesReqRev.aspx.vb:95 System.Web.UI.WebControls.Button.OnClick(EventArgs e) System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) System.Web.UI.Page.ProcessRequestMain()
Gurjit [ bhui_gurjit ( at ) yahoo dot com ],
2005-03-28 14:34:57
#
-
System.Runtime.InteropServices.COMException: At least one of the From or Sender fields is required, and neither was found.
[ Reply ]
Hi there!
I am getting System.Runtime.InteropServices.COMException: At least one of the From or Sender fields is required, and neither was found.
[COMException (0x8004020d): At least one of the From or Sender fields is required, and neither was found.]
I have specified them... I followed the examples..
<code> Sub Page_Load(Sender as Object, e As System.EventArgs)
Dim Mail as new MailMessage() Mail.To = "dave@davejenkins.co.uk" Mail.From = txtAddress.Text Mail.Subject = txtSubject.Text Mail.Body = txtMessage.Text & "<br/><br/>" & txtName.Text SmtpMail.SmtpServer = "mail.davejenkins.co.uk" SmtpMail.Send(mail)
End Sub </code> Thanks for any help!
David Jenkins [ webmaster ( at ) rpgsearch dot co dot uk ],
2005-04-11 15:39:52
#
-
800A0400 Error Message
[ Reply ]
I am trying to run this piece of code on my Windows 2000 Server with IIS5 and keep getting the following message:
Script: e:\blanksite\CDO.vbs Line: 1 Char: 1 Error: Expected statement Code: 800A0400 Source: Microsoft VBScript comiplation error
I have latest VBscript on the server. What about permissions?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <% sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields .Item(sch & "sendusing") = "25" ' cdoSendUsingPort .Item(sch & "smtpserver") = "127.0.0.1" .update End With
Set cdoMessage = CreateObject("CDO.Message")\ With cdoMessage Set .Configuration = cdoConfig .From = "supp...@abc.com" .To = "dfors...@abc.com" .Subject = "Sample CDO Message" .TextBody = "This is a test for CDO.message" .Send End With
Set cdoMessage = Nothing Set cdoConfig = Nothing %> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dennis [ interflex ( at ) hotmail dot com ],
2005-04-19 16:47:05
#
-
can't send email with attached file whose name contain unicode characters
[ Reply ]
hi dave,
I've gone through your FAQ quickly, but can't find the same problem I'v met, so I want to share this.
I am developing a windows service to send emails with different kinds of attachments. By setting the default language setting for the system to Chinese, my service can send emails with Chinese named files (also valid ASCII named files) but can't send files whose names contain Arabic and Korean characters.
The exection is still the famous "Could not access 'CDO.Message' object."
The inner exception is "The filename, directory name, or volume label syntax is incorrect."
When I changed the default language for system to Korean, Korean named files can be attached to mails and sent. But it does not support the Chinese named files any more.
This is not acceptable by setting the default language for system to one specific language to support the attached file with filename in this language.
I have the authentication section for smtp sever. Here is the code: ======================================= Dim lobj_msg As New Web.Mail.MailMessage Try If System.IO.File.Exists(TextBox1.Text) Then lobj_msg.BodyEncoding = Encoding.UTF8
lobj_msg.To = "busbby@msn.com" lobj_msg.Subject = "mail from web.mail.mailmessage" lobj_msg.Body = " hello" lobj_msg.Attachments.Add(New Web.Mail.MailAttachment(Me.TextBox1.Text)) lobj_msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2) lobj_msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") lobj_msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "guest") lobj_msg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password")
SmtpMail.SmtpServer = "smtpx.xxx.com" SmtpMail.Send(lobj_msg) Else MsgBox("file " & Me.TextBox1.Text & " does not exist!!!") End If
Catch ex As Exception MsgBox("Error:" & vbNewLine & ex.Source & vbNewLine & ex.Message) End Try lobj_msg = Nothing ======================================= I think the web.mail.mailmessage does not fully support attached files with unicode characters.
Any ideas? Thanks in advance.
busbby [ busbby ( at ) msn dot com ],
2005-07-06 02:04:02
#
-
"Could not access 'CDO.Message' Object - Part 10
[ Reply ]
This is what worked for me !
1) Open the registry 2) Navigate to 'HKEY_CLASSES_ROOT\CDO.Message' 3) Right click the 'CDO.Message' key and select permissions... 4) Add the local ASPNET user and give it read permission 5) Click OK to apply the changes 6) Restart your application and give it another try !
CooLy...
CooLy [ cooly1 ( at ) gmail dot com ],
2006-06-23 06:04:28
#
-
CDO
[ Reply ]
My computer is running XP. I used system restore and went back to an earlier time and restored back to present time.
That did it!!!
Hary [ justundefeated ( at ) yahoo dot com ],
2006-10-11 12:35:32
#
-
The server response was: 451 Blocked - see http://www.spamcop.net/bl.shtml?202.65.134.20
[ Reply ]
can any one help me. i am trying out from long time. it is throwing errors like this Below is the code i used: --------------------------------------------- Dim objMail as New MailMessage() objMail.To="butlerr@otc.edu" objMail.From=txtEmail.Text objMail.Subject="Contact Us" objMail.BodyFormat=MailFormat.Text objMail.Body="Name: " & txtName.Text & vbcrlf objMail.Body &="Email Address: " & txtEmail.Text & vbcrlf objMail.Body &="Comments: " & txtComments.Text & vbcrlf objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", 1) 'basic authentication objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "smtpserver.com") 'set your username here objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "pwd") 'set your password here ' - smtp.gmail.com use port 465 or 587 ' objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", "587") ' objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", "true") objMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout", 60) objMail.Fields.Add 'SmtpMail.SmtpServer="smtpserver.com" SmtpMail.Send(objMail)
arjun kamlakar [ arjun dot k ( at ) hochtechnologies dot com ],
2007-01-19 08:29:49
#
|