|
-
Feb 3rd, 2001, 11:44 AM
#1
Thread Starter
New Member
How does the MSMapi32 api work? Is it possible to use it to send email without the user seeing? I don't have this on my machine, can I get it? How? Please I need help I don't know what I'm doing but I need to figure this out.
-
Feb 6th, 2001, 10:39 AM
#2
Frenzied Member
COMPLEX
Typically, in almost anything you do, you will NOT want to use the MAPI interfaces directly.
They are complex, designed for use from C, and require lots of understanding about Outlook and what Exchange is trying to do.
Alternatives:
Take a look at Chapter 5 of the MS Office 2000 - Visual Basic Programmers Guide (available on Technet and other places). This describes use of Outlook from OLE Automation point of view.
E.G:
Function CreateMail(astrRecip As Variant, _
strSubject As String, _
strMessage As String, _
Optional astrAttachments As Variant) As Boolean
' This procedure illustrates how to create a new mail message
' and use the information passed as arguments to set message
' properties for the subject, text (Body property), attachments,
' and recipients.
Dim objNewMail As Outlook.MailItem
Dim varRecip As Variant
Dim varAttach As Variant
Dim blnResolveSuccess As Boolean
On Error GoTo CreateMail_Err
' Use the InitializeOutlook procedure to initialize global
' Application and NameSpace object variables, if necessary.
If golApp Is Nothing Then
If InitializeOutlook = False Then
MsgBox "Unable to initialize Outlook Application " _
& "or NameSpace object variables!"
Exit Function
End If
End If
Set golApp = New Outlook.Application
Set objNewMail = golApp.CreateItem(olMailItem)
With objNewMail
For Each varRecip In astrRecip
.Recipients.Add varRecip
Next varRecip
blnResolveSuccess = .Recipients.ResolveAll
For Each varAttach In astrAttachments
.Attachments.Add varAttach
Next varAttach
.Subject = strSubject
.Body = strMessage
If blnResolveSuccess Then
.Send
Else
MsgBox "Unable to resolve all recipients. Please check " _
& "the names."
.Display
End If
End With
CreateMail = True
CreateMail_End:
Exit Function
CreateMail_Err:
CreateMail = False
Resume CreateMail_End
End Function
-
Feb 6th, 2001, 03:58 PM
#3
Thread Starter
New Member
Thanks
Thanks a bunch for the help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|