Solved

using mapi with visual basic

Posted on 2001-08-16
6
527 Views
Last Modified: 2013-11-25
how do i send mail messages with the mapi controls to many recipient at a time using the BCC (other people don't see to whom the mail has been sent?)
thx
David
0
Comment
Question by:davtoche
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 1

Expert Comment

by:Ranger2081200
ID: 6392034
davtoche,

I use the MAPIMessages control.
Once I have entered the recipients I want to send the message to, I then use RecipType = 3

Example:

MAPISession1.LogonUI = False
MAPISession1.UserName = "MICROSOFT OUTLOOK"
MAPISession1.SignOn
MAPIMessages.SessionID = MAPISession1.SessionID
MAPIMessages.Compose
MAPIMessages.RecipDisplayName = "Test User"
MAPIMessages.RecipAddress = "TestUser@somewhere.com"
MAPIMessages.ResolveName
MAPIMessages.RecipType = 3      '<***** This is Bcc *******
MAPIMessages.MsgSubject = "test!"
'Create the message
MAPIMessages.MsgNoteText = strEmailMessage
MAPIMessages.Send False
MAPISession1.SignOff

The 3 is "Bcc"
2 is "cc"
1 is "To"

Later...
0
 

Author Comment

by:davtoche
ID: 6392518
Thank you very much
Great!!
0
 

Author Comment

by:davtoche
ID: 6392573
how do i type :
MAPIMessages.RecipAddress = "TestUser@somewhere.com"
to have a list of recipients?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
Ranger2081200 earned 100 total points
ID: 6396132
davtoche,

The way that I do it is to loop through a recordset or array or something like that.

For example:
I'll use a textbox control array.  I have 5 people I want to sent email to, so I create 5 textboxes called "Text" and add the names of the recepients into each textbox.  Then I loop through the textboxes then send the email.
Use of the MAPIMessages.RecipIndex allows this.
Text(1) = "TestUser@somewhere.com"
Text(2) = "TestUser2@somewhere.com"
and so on...

code looks like this:

---------------------------------------------------------
dim i as integer
dim strEmailMessage as string

MAPISession1.LogonUI = False
MAPISession1.UserName = "MICROSOFT OUTLOOK"
MAPISession1.SignOn
MAPIMessages.SessionID = MAPISession1.SessionID
MAPIMessages.Compose
For i = 0 To Text.Count - 1
    MAPIMessages.RecipIndex = MAPIMessages.RecipCount
    MAPIMessages.RecipDisplayName = Text(i)
    MAPIMessages.RecipAddress = Text(i)
    MAPIMessages.ResolveName
    MAPIMessages.RecipType = mapBccList
Next i
MAPIMessages.MsgNoteText = strEmailMessage
MAPIMessages.Send False
MAPISession1.SignOff

---------------------------------------------------------

I told you that the "3" was for Bcc and that is correct but you can also use the mapBccList to make it easier to understand.
mapToList = Primary recepient
mapCcList = Carbon copy recepients
mapBccList = Blind Carbon copy recepients

Later...
0
 

Author Comment

by:davtoche
ID: 6396364
thnk you ranger2
i didn't try but i'm sure it'll work
Talk to you soon for sthing else
David
0
 

Expert Comment

by:Nilesh Havire
ID: 31386693
can we sent the mail to,cc,bcc recipient at same time
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question