> I can successfully use MAPI to send email (MS Outlook Express verision 5),
> but with one shortcoming: I want to be able to override the Default
> Assume the I have 2 email accounts: Grapefruit (default) and Banana. Both
> are valid mail accounts and both work in Outlook Express. When I send
> via OE manually, the send mail dialog shows (by default) the Grapefruit
> account in the From box, but if I want the mail to be sent from the Banana
> account, I can simply select that acount from the combo box, and the
> recipient receives mail from Banana.
> I want to achieve the same using VB6. The following code send mail just
> fine but always uses the default account, and I can find no way to
> this. I've tried various combinations of UserName, LogonUI, and
> properties. I've searched the Microsoft MSDN site to no avail.
> Private Sub SendMail()
> ' A Form provides controls for specifying Profile (UserName),
> ' LogonUI, and NewSession
> MAPISession1.DownLoadMail = False
> MAPISession1.NewSession = (checkboxNewSession = vbChecked)
> MAPISession1.LogonUI = (checkboxLogonUI = vbChecked)
> MAPISession1.UserName = textboxProfile.Text
> MAPIMessages1.SessionID = MAPISession1.SessionID
> MAPIMessages1.RecipIndex = 0
> MAPIMessages1.RecipAddress = textboxRecipient.Text
> MAPIMessages1.MsgSubject = "My Subject"
> MAPIMessages1.MsgNoteText = "My Message Body"
> ' Although the actual intent is to send mail without the Dialog box,
> ' set VDailog:=True here in order to see who the mail Sender is (i.e.,
> ' we get the expected profile).
> MAPIMessages1.Send vDialog:=True
> End Sub