Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

using CDO to send email

Posted on 2004-09-07
8
Medium Priority
?
460 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
6 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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

Hire Technology Freelancers with Gigs

Work with 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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 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…
Suggested Courses

783 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