Changing recipient list using protocol event sink
Exchange Server Forum Index Exchange Server
Discussion forums for Microsoft Exchange Server users.
Microsoft Outlook
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web ExchangeServerHelp.com
Changing recipient list using protocol event sink

 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development
Author Message
ashu139



Joined: 03 Sep 2009
Posts: 1

Posted: Thu Sep 03, 2009 11:19 am    Post subject: Changing recipient list using protocol event sink Reply with quote

I am bit new to exchange programming...I am implementing a protocol event sink with ISmtpInCommandSink interface and I am successful in getting the list of recipients through IMailMsgRecipientsBase Interface. Now I need to add my custom recipient to the message.I checked this using GetStringA( IMMPID_MP_RFC822_TO_ADDRESS....) but I getting the old recipient here. Also the message did not delivered to neither to old recipient nor to new recipient.

Any kind of help is just welcome...please...


IMailMsgRecipients *pIRcpt = {0};
IMailMsgRecipientsAdd *pIRcptAdd = {0};
hr = pIMsg->QueryInterface(__uuidof(IMailMsgRecipients),(LPVOID *)&pIRcpt);

//Get number of recipients
hr = pIRcpt->Count( &dwCount);
if( FAILED( hr ) )
{
goto EXIT;
}
//Get recipients name
hr = pIRcpt->Item(0,0,NAME_LEN,szRcptName );
if( FAILED( hr ) )
{
goto EXIT;
}

//Allocate new list for recipients
hr = pIRcpt->AllocNewList(& pIRcptAdd);
if( FAILED( hr ) )
{
goto EXIT;
}
//Add recipients
NSZ szPropBuffer[NAME_LEN] = "";
strcpy(szPropBuffer,"Administrator@nasa.local");
hr = pIRcptAdd->AddPrimary(1,(LPCSTR*) & pszPropBuffer,&dwPropID, &dwIndex,NULL, 0);
if( FAILED( hr ) )
{
goto EXIT;
}
hr = pIRcpt->WriteList(pIRcptAdd);
if( FAILED( hr ) ){
goto EXIT;
}
}

hr = pIMsg->GetStringA( IMMPID_MP_RFC822_TO_ADDRESS, sizeof(NSZ)*128, pszPropBuffer );
if( FAILED( hr ) )
{
goto EXIT;
}

Back to top
View user's profile Send private message
 
Post new topic   Reply to topic    Exchange Server Forum Index -> Development All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Access Forum - Dedicated Servers

Contact Us Powered by phpBB