Re: VB6 MAPI



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
:
:
:
:

.



Relevant Pages

  • Re: Excess email from Exchange Administrator
    ... emails: 1) Using POP3 Connector to retrieve emails from the ISP mailboxes ... These incoming emails are directly delivered to the Exchange Server via ... Exchange?2003 supports recipient filtering. ... or e-mail messages that are addressed to recipients who are ...
    (microsoft.public.windows.server.sbs)
  • Re: Can not view BCC receipents in sent items folder
    ... The number of recipients limit is set on our Exchange 2003 SP2 server is 5000. ... There isn't a problem sending out the emails. ... Just the receipient list isn't being shown in the BCC field in ... populated when Outlook sent the e-mail. ...
    (microsoft.public.outlook.general)
  • Re: Questions about invalid email addresses
    ... there are no such logs just logging failed incoming emails ... addressed to non existent recipients. ... Microsoft CSS Online Newsgroup Support ... This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: Compressing a file
    ... it as an attachment because it is almost 27 MB and most emails will ... file you wish to upload. ... you the download link. ... it into the message to your recipients. ...
    (microsoft.public.windowsxp.photos)
  • Re: "A configuration error in the e-mail system..."
    ... emails as you can tell from the subject line that the email sent is ... Your message did not reach some or all of the intended recipients. ... message to bounce between two servers or to be forwarded between two ... i.e., router A thinks that in order to reach the recipient, ...
    (microsoft.public.outlook)