Results 1 to 3 of 3

Thread: Senders email using MAPI

  1. #1

    Thread Starter
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512

    Senders email using MAPI

    Hi peeps,

    Ive written an email client using MAPI but it always uses the default mail client and i would like to be able to select from a list which email i want to sent it from. Can this be done?

    I have 5 email accounts set up in outlook express and 1 is set as the default. This is the one MAPI always sends the emails from but i need to choose or hard code a different one.

    Hope this will mean something to someone

    Thanks very much
    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

  2. #2

  3. #3

    Thread Starter
    Frenzied Member Blobby's Avatar
    Join Date
    Oct 2001
    Location
    England
    Posts
    1,512

    Re: Senders email using MAPI

    Hi Martin, thanks for the reply, it does kind point me in the right direction altho im doing it differently to that code in the link and i cant figure out what i need to do to the way im doing it to get it to do the same.

    my code is:
    VB Code:
    1. Private Sub CommandEmail_Click()
    2.     'MAPISession1.UserName = EmailFrom
    3.     'MAPISession1.Password = Password
    4.         MAPISession1.SignOn
    5.         MAPIMessages1.a
    6.         If Err.Number = 0 Then
    7.             For Index = 0 To UBound(Email)
    8.                 With MAPIMessages1
    9.                         .SessionID = MAPISession1.SessionID
    10.                         .Compose
    11.                         .RecipAddress = Email(Index)
    12.                         .ResolveName
    13.                 'For a second addressee add:
    14.                 ' .RecipIndex = 1
    15.                 ' .RecipAddress = "[email protected]"
    16.                 ' .ResolveName
    17.                 ' Might need to add:
    18.                 ' .AddressResolveUI = True
    19.  
    20.                     .MsgSubject = EmailSubject
    21.                     .MsgNoteText = RichTextBox1.Text
    22.                     '.AttachmentIndex = 0
    23.                     '.AttachmentPosition = 0
    24.                     '.AttachmentPathName = ""
    25.                     .Send
    26.                 End With
    27.             Next
    28.         End If
    29.         MAPISession1.SignOff
    30.  
    31.  
    32. End Sub

    I may have to use winsock as i cant see any properties that will allow me to change the senders details.

    There are 3 types of people in this world.........those that can count, and those that can't.

    Blobby

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