Results 1 to 3 of 3

Thread: Email bitmap attachments

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Taipei
    Posts
    318

    Cool

    I use the following codes to send email and attachments

    (Courtesy of MarkSleeve)

    Dim oSession As MAPI.Session
    Dim oMessage As MAPI.Message
    Dim oRecipient As MAPI.Recipient


    Set oSession = CreateObject("MAPI.Session")

    oSession.Logon "Microsoft Outlook" 'this will promt for a profile. This can be avoided by including the profile name

    Set oMessage = oSession.Outbox.Messages.Add
    With oMessage
    .Subject = "Email From Chong For Testing"
    .Text = "This is a test message from kmchong"
    .Attachments.Add "c:\temp\screencam.bmp"

    Set oRecipient = oMessage.Recipients.Add
    oRecipient.Name = "[email protected]"
    oRecipient.Resolve

    .Update
    .Send

    End With

    oSession.Logoff
    Set oSession = Nothing
    Set oMessage = Nothing
    Set oRecipient = Nothing


    It works to send the subject and text attachment. But if I send bitmap attachment, the received file is blank (when I use paintbush to view)

    Do anybody can tell me WHY?



  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Hmm... it didn't seem to want to work for me with bitmaps either!

    You could ytr using the Outlook object libriary instead as it seems a bit more robust.
    Mark
    -------------------

  3. #3
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670
    ..or you could download BuzMail from http://www.PlanetSourceCode.com/vb - just search for "BuzMail". This is my MAPI 'object' that allows you to send e-mails with or without attachments without having to resort to the horrible MS MAPI commands.
    'Buzby'
    Visual Basic Developer
    "I'm moving to Theory. Everything works there."

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