Re: VB6 MAPI
- From: "Randy Birch" <rgb_removethis@xxxxxxxx>
- Date: Wed, 27 Jul 2005 22:46:31 -0400
Are you sending the same response to each of the 7 recipients? If so, you
can indicate all 7 in one email, either as recipients, CC recipients or
blind copy recipients. No need to send seven different emails to seven
addresses is they all get the same thing. Just increment the recipients
count and indicate what type of recipient they are.
For example, assuming you have a UDT array containing the recipient info,
such as:
Private Type RecipientDetails
DisplayName As String
EmailAddress As String
RecipientType As Integer
End Type
Dim Recip(0 To 6) As RecipientDetails
.... and you fill it with data as:
Recip(0).DisplayName = "Randy" 'display name
Recip(0).EmailAddress = "him1@xxxxxxxx" 'email address
Recip(0).RecipientType = mapToList 'field to fill
Recip(1).DisplayName = "Brian"
Recip(1).EmailAddress = "him2@xxxxxxxx"
Recip(1).RecipientType = mapCcList
Recip(2).DisplayName = "John"
Recip(2).EmailAddress = "him3@xxxxxxxx"
Recip(2).RecipientType = mapCcList
Recip(3).DisplayName = "James"
Recip(3).EmailAddress = "him4@xxxxxxxx"
Recip(3).RecipientType = mapCcList
Recip(4).DisplayName = "Wally"
Recip(4).EmailAddress = "him5@xxxxxxxx"
Recip(4).RecipientType = mapCcList
Recip(5).DisplayName = "Bill"
Recip(5).EmailAddress = "him6@xxxxxxxx"
Recip(5).RecipientType = mapBccList
Recip(6).DisplayName = "Larry"
Recip(6).EmailAddress = "him7@xxxxxxxx"
Recip(6).RecipientType = mapBccList
.... then this sends the same message to all seven ...
Private Function MapiMsgSendToMultipleRecipients() As Boolean
On Local Error GoTo mapisendmulti_error
Dim cnt As Long
Dim sMessageSubject as string
Dim sMessageBody as string
'fill in these:
sMessageSubject = "????"
sMessageBody = "????"
'parameters for a MAPI session
With MAPISession1
.NewSession = False
.LogonUI = False
.DownLoadMail = False
.UserName = "MVPS Mail"
.SignOn
End With
'parameters for the message
With MAPIMessages1
'assign session ID
.SessionID = MAPISession1.SessionID
'clear compose buffer
.Compose
'set MsgIndex
.MsgIndex = -1
'set the recipient index, name, address and type
For cnt = 0 To 6
.RecipIndex = cnt
.RecipDisplayName = Recip(cnt).DisplayName
.RecipAddress = Recip(cnt).EmailAddress
.RecipType = Recip(cnt).RecipientType
Next
'subject
.MsgSubject = sMessageSubject
'message body
.MsgNoteText = sMessageBody
.Send False 'False sends immediately; True previews message
End With
'end the messaging session and sign user off
MAPISession1.SignOff
Exit Function
mapisendmulti_error:
MsgBox Err.Description
If MAPISession1.SessionID Then MAPISession1.SignOff
End Function
--
Randy Birch
MS MVP Visual Basic
http://vbnet.mvps.org/
----------------------------------------------------------------------------
Read. Decide. Sign the petition to Microsoft.
http://classicvb.org/petition/
----------------------------------------------------------------------------
"Bob Beed" <snowy_4@xxxxxxxxxxx> wrote in message
news:42e74473$1_1@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
:I want to be able to respond to a received email by sending 7 emails. This
: is not possible using Outlook Express message rules, I am therefore trying
: to
: use VB 6 MAPI.
:
: I have managed to get it to work but occasionally 2 or 3 of my reply
emails
: seem to get stuck in the outlook express Outbox.
:
: It is almost as if the VB6 is too fast for Outlook Express. I have tried
: putting a delay into my VB6 routine but with limited success.
:
:
:
: 1. Is there a protocol I should be using to check if Outlook express has
: sent my messages from the Outbox?
: 2. Can I force the mesages in the outbox to be sent immediately?
: 3. Can I bypass the Outbox?
:
: Thanks
:
: Bob Beed UK
:
:
:
:
.
- Follow-Ups:
- Re: VB6 MAPI
- From: Bob Beed
- Re: VB6 MAPI
- References:
- VB6 MAPI
- From: Bob Beed
- VB6 MAPI
- Prev by Date: Re: Funny OT
- Next by Date: Re: Visual Basic.net
- Previous by thread: VB6 MAPI
- Next by thread: Re: VB6 MAPI
- Index(es):
Relevant Pages
|