Results 1 to 3 of 3

Thread: MSMapi32 Help

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Location
    ohio
    Posts
    3

    Question

    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.
    Yeeeeeeehaaaaaaw

  2. #2
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Newbury, UK
    Posts
    1,878

    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2001
    Location
    ohio
    Posts
    3

    Thanks

    Thanks a bunch for the help.
    Yeeeeeeehaaaaaaw

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width