Solved

using CDO to send email

Posted on 2004-09-07
8
438 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
  • 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

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…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

776 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