Results 1 to 6 of 6

Thread: prob with email application I am writing in VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    S.A
    Posts
    15

    Question

    how do I attach a file to the email.
    I am using the CDO libary,
    I dimmed the following:

    dim objSession as MAPI.Session
    dim objMessage as MAPI.Message

    Create the Session:

    Set objSession = CreateObject("Mapi.Session")

    log onto session:

    objSession.Logon SETTINGS
    strUserName = objSession.CurrentUser

    created the message and fill in its properties:

    Set objMessage = objSession.Outbox.Messages.Add
    objMessage.Subject = txtSubject.Text
    objMessage.Text = txtMessage.Text
    objMessage.Attachments.Add ??????

    I don't know how assign and load the file I want into the message.
    can brown cows fly???

  2. #2
    Addicted Member JasonGS's Avatar
    Join Date
    May 2000
    Location
    California
    Posts
    155

    Smile just a suggestion

    I've messed with CDO before and I found that for MAPI stuff it's hard to beat, but if you're looking to do SMTP/POP3; I would download AspEmail (http://www.persits.com/aspemail.exe) because it's free (I think) and distributable as one .DLL and it does everything (including attachments) really easily.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Location
    S.A
    Posts
    15

    ???

    the app uses the users outlook or ms exhange setting,
    all I need to do is assign the attachment to the file but she won't work.
    can brown cows fly???

  4. #4
    Lively Member
    Join Date
    Jun 2000
    Location
    A caravan park in the Midlands (UK)
    Posts
    101

    Outlook object lib

    If the all the users have outlook why not swap to using the outlook object library? You can then use the Attachment object of the MailItem.

    I can't help with the MAPI stuff (got some examples but not got round to looking at them!), we needed something like yesterday and the outlook lib was quickest way to get a solution.
    Anakim

    It's a small world but I wouldn't like to paint it.

  5. #5
    obezyanka
    Guest
    This is how I did it.

    '''''''''''''''''''''''
    Dim AttachmentFile As String

    MAPIMessages1.SessionID = MAPISession1.SessionID
    With MAPIMessages1
    AttachmentFile="C:\Test\Test.txt"
    .AttachmentPathName = AttachmentFile
    End With
    '''''''''''''''''''''''''

    Hope, it'll help.

  6. #6
    Lively Member knochenfish's Avatar
    Join Date
    Apr 2001
    Location
    Cologne
    Posts
    77
    Hi there,

    i had a problem with attachments too. after day´s of searching i found out that you need for every attachment a character in the messagebody.

    wolf

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