Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Sending MAPI Mail with cc


This question is answered.


Permlink Replies: 2 - Last Post: Sep 20, 2016 9:59 AM Last Post By: Melissa Torn
Melissa Torn

Posts: 143
Registered: 4/30/09
Sending MAPI Mail with cc  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 11, 2016 2:49 AM
I am trying to send a mail to both
a recepient & also cc. With below code
i can send to just Recipient without any problem
How can i also add the mail adresses into cc in the mail ?

var RecipientEMail, ccMailAdress : String;
begin
........
........
if (RecipientEmail <> '') then
begin
lpRecipient.ulRecipClass := MAPI_TO;
if (RecipientName = '') then
lpRecipient.lpszName := PAnsiChar(AnsiString(RecipientEMail)) else
lpRecipient.lpszName := PAnsiChar(AnsiString(RecipientName));
lpRecipient.lpszAddress := PAnsiChar(AnsiString(RecipientEmail));
lpRecipient.ulReserved := 0;
lpRecipient.ulEIDSize := 0;
lpRecipient.lpEntryID := nil;
nRecipCount := 1;
lpRecips := @lpRecipient;
end else
lpRecips := nil;

......
.......
end;
Thank you so much
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Sending MAPI Mail with cc
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 12, 2016 2:19 PM   in response to: Melissa Torn in response to: Melissa Torn
Melissa wrote:

I am trying to send a mail to both
a recepient & also cc. With below code
i can send to just Recipient without any problem
How can i also add the mail adresses into cc in the mail ?

The message's lpRecips field is a pointer to an array of recipients, where
each entry specifies whether it is a TO, CC, or BCC recipient. Your code
is currently creating 1 recipient that is set to MAPI_TO. To do what you
are asking, create an array containing 2 recipients, where the first entry
is set to MAPI_TO and the second entry is set to MAPI_CC.

--
Remy Lebeau (TeamB)
Melissa Torn

Posts: 143
Registered: 4/30/09
Re: Sending MAPI Mail with cc  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Sep 20, 2016 9:59 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Thank you so much Remy,
Can i find some sample code in Internet ?
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02