Solved

using CDO to send email

Posted on 2004-09-07
8
440 Views
Last Modified: 2013-12-25
I have working with VB6.0 and want to use CDo to send Email.
for this I have created a Class and this class has one function sendmessage please see below for the function
 

this is the class
************
option explicit
private CDOmsg as cdo.message

Public Function sendMessage(ByVal sAddress As String, _
                            ByVal sSubject As String, _
                            ByVal sMessage As String, _
                            Optional ByVal sAttachment As String) As Boolean
On Error GoTo functionError
    Dim txt As String
    Set CDOmsg = New CDO.Message
    CDOmsg.To = sAddress
    CDOmsg.From = "ABC@Some.com"
    CDOmsg.Subject = sSubject
    CDOmsg.TextBody = sMessage
    If sAttachment <> "" Then
        CDOmsg.AddAttachment sAttachment
    End If
    CDOmsg.Send                    ' here i get an error "The "SendUsing" configuration value is invalid." and it exits the function
 
   sendMessage = True

end function

Private Sub Class_Initialize()
    Set CDOmsg = New CDO.Message
End Sub
***********************************

i created an instance of this class from another module
 Dim obj As AboveClass
  Set obj = New AboveClass

and i call the funciton from the above class

obj.sendmessage "some@hotmail.com","Some subject"," here is the message"

' call runs fine till it reaches the CDOmsg.send statement in the function and then gives me error "The "SendUsing" configuration value is invalid."
0
Comment
Question by:JuniorDeveloper2000
[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
  • 3
  • 2
8 Comments
 

Author Comment

by:JuniorDeveloper2000
ID: 12001438
Guys its kinda urgent
Thanks in advance
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 12001908
0
 

Author Comment

by:JuniorDeveloper2000
ID: 12007066
my work enviournment needs me to use CDO
0
Technology Partners: 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!

 

Author Comment

by:JuniorDeveloper2000
ID: 12039918
I created a Class to send the emails. I used mapi.session, now it works fine using the new class i created. Thanks for all your help.
hey guys Can any one tell me how to close the questions i have posted. once i have accepted the answer or i have figured out a way to do it myself.

Thanks
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 12039994
I you want to have a question deleted or sent to PAQ, you need to post a 0-point in the Community Support: http://www.experts-exchange.com/Community_Support/
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12988999
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

710 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