how to assign multiple Mail ids to CC - using MAPI Handler

kishi_g
Member Posts: 162
Hi,
Iam sending mails by using MAPI Handler. my problem is i assigned multipled mail id's to MAPIHandler."CC Name" then mail will not be generated. if i assigned single mail id to MAPIHandler."CC Name" then only mail will be generated.
how can i assign multiple mail id's to MAPIHandler."CC Name" .
Thanks & Regards,
Kishore....
Iam sending mails by using MAPI Handler. my problem is i assigned multipled mail id's to MAPIHandler."CC Name" then mail will not be generated. if i assigned single mail id to MAPIHandler."CC Name" then only mail will be generated.
how can i assign multiple mail id's to MAPIHandler."CC Name" .
Thanks & Regards,
Kishore....
0
Comments
-
The problem with the code examples I found were that they only showed how to send an e-mail to 1 person or CC 1 person. Problem was when you wanted more than 1 person on the list.
I was using Mapi.
All the examples I found were resolving the names after the To string or CC string had been created. This gave the error that Mapi could not resolve the To or CC.
This worked for me!!!!!!!
IF CCName <> '' THEN BEGIN
// Multiple Receipients
WHILE STRPOS(CCName, ';') > 0 DO BEGIN
MAPIMessages.RecipIndex := MAPIMessages.RecipCount;
MAPIMessages.RecipType := 2;
MAPIMessages.RecipDisplayName := COPYSTR(CCName,1, STRPOS(CCName, ';')-1); //INSERTED CODE TO STRIP SINGLE NAME FROM STRING
MAPIMessages.AddressResolveUI(HideDialog);
MAPIMessages.ResolveName; //INSERTED CODE TO RESOLVE RECIPIENT
CCName := DELSTR(CCName,1, STRPOS(CCName, ';'));
END;
MAPIMessages.RecipIndex := MAPIMessages.RecipCount;
MAPIMessages.RecipType := 2;
MAPIMessages.RecipDisplayName := CCName;
END;
MAPIMessages.MsgSubject := Subject;
IF AttachFileName = '' THEN
MAPIMessages.MsgNoteText := Body + Body2 + Body3 + Body4 + Body5
ELSE BEGIN
MAPIMessages.MsgNoteText := Body + ' ';
MAPIMessages.AttachmentIndex := MAPIMessages.AttachmentCount;
MAPIMessages.AttachmentType := 0;
MAPIMessages.AttachmentPathName := AttachFileName;
MAPIMessages.AttachmentPosition(STRLEN(Body));
END;
//REMOVED CODE WHICH WAS ONLY RESOLVING THE NAME AT THE END OF THE ROUTINE
//IF (ToName <> '') OR (CCName <> '') THEN BEGIN
// MAPIMessages.AddressResolveUI(TRUE);
//MAPIMessages.AddressResolveUI(HideDialog);
//MAPIMessages.ResolveName;
//END;0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions