Solved

Send E-Mail (CDO) Win2K / XP  {Hell}

Posted on 2002-06-19
8
304 Views
Last Modified: 2007-12-19
Hey guys,

I am very frusted at this point. I have upgraded my development machine to XP Professional as per request and now everytime i recompile my applications my send e-mail procedures don't work.

Here's how my code used to be:

Dim cdoObj As CDO.Message
Set cdoObj = New CDO.Message

With cdoObj
    .To = "user@domain.com"
   .From = "anotheruser@domain.com"
   .TextBody = strMessage
   .Send
End With

Set cdoObj = Nothing

and this used to work just fine. Now when i go to the References window in my project there are 2 CDO Libraries:

 - Microsoft CDO For Exchange 2000 Library (This is automatically selected when i open my projects)
 - Microsoft CDO 1.21 Library


I have been searching on msdn.microsoft.com and have tried all the settings i could imagine but still my e-mails don't get delivered. They don't get posted in the PickUp Directory. They all go to the C:\Inetpub\mailroot\Badmail directory.


Here's the error in one of the files:


Unable to deliver this message because the follow error was encountered: "Error is processing file in pickup directory.".

The specific error code was 0xC00402CE.


I get this error in both machines (XP/Win2K). But there are no erros from VB.

Any help would be appreciated.
Thanks.

0
Comment
Question by:Dxpert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 18

Expert Comment

by:mdougan
ID: 7093147
Here is the code I've been using to send e-mails successfully.  I got this out of the MSDN help for CDO version 1.2

Dim objSession As Object
Dim objMessage As Object
Dim objRecipient As Object

    On Error GoTo ErrorRtn

    'Create the Session Object
    Set objSession = CreateObject("mapi.session")
   
    objSession.Logon profileName:="Outlook"
           
    'Add a new message object to the OutBox
    Set objMessage = objSession.Outbox.Messages.Add
   
    objMessage.Subject = sSubjectText
   
    objMessage.Text = sBodyText

    'Add a recipient object to the objMessage.Recipients collection
     Set objRecipient = objMessage.Recipients.Add
           
     'Set the properties of the recipient object
     objRecipient.Address = "SMTP:bob@yahoo.com"
     'not sure what this refers to but only type 1 works
     objRecipient.Type = 1
           
     objRecipient.Resolve
           
     objMessage.Send showDialog:=False
   
    'Logoff using the session object
    objSession.Logoff
     
ExitRtn:
    Set objSession = Nothing
    Set objMessage = Nothing
    Set objRecipient = Nothing

    Exit Function
ErrorRtn:
    GoTo ExitRtn
0
 
LVL 10

Author Comment

by:Dxpert
ID: 7093161
Does this code work on a box without office installed? I need to run it on a server that is running only IIS.

Thanks
=:-)
0
 
LVL 18

Expert Comment

by:mdougan
ID: 7093552
The code I gave will probably not run without some sort of MAPI compliant client software installed.  And, if the client is Outlook, then it also needs a default profile set up.

The last time I looked into sending e-mail from a Server without a user logged in (which throws off the default profile thing as this depends on the current logged on user), the only solution was to use CDONTS (the NTS stands for NT Server).

If you are running an NT Sever, you probably have CDONTS installed, so, no problem there.  You'd need to reference CDONTS and not CDO in your VB project, then, you'll need sample source for using CDONTS, but I don't have any on hand.  I'll take a quick look around, but this might give you something to go on for the moment.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Author Comment

by:Dxpert
ID: 7104826
I am using winXP prof. and win2K server.
0
 

Expert Comment

by:robrien6
ID: 7356521
The equivalent object for winxp is called CDOSYS.

You can find details (and samples of its use) of it here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wss/wss/_clb_sending_smtp_mail_by_port_25_using_cdosys_vb.asp

0
 
LVL 10

Author Comment

by:Dxpert
ID: 7677109
I will delete this question as none of the above comments has directly provided me with a solution for my problem. I put win2k back on my computer.

Thank you all.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7923617
Dxpert, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Refund points and save as a 0-pt PAQ.

DanRollins -- EE database cleanup volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7968380
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question