Solved

using CDO to send email

Posted on 2004-09-07
8
442 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
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!

 

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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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 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…
Suggested Courses
Course of the Month9 days, 11 hours left to enroll

623 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