A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Retrieve recipients smtp address using Redemption + Outlook 2003



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 18th 08, 04:04 PM posted to microsoft.public.outlook.program_forms
CoolSanil
external usenet poster
 
Posts: 2
Default Retrieve recipients smtp address using Redemption + Outlook 2003

Hello I want to receive recipients (address from TO,CC)from the incoming mail
using Redemption for Outlook 2003. I am able to get recipients pointer from
SafeMailItem. When i try to itrate trough recipients to get address of the
recipient it always give me null. But when i use Outlook::Recipient i get
recipients email addresss but for exchange users email address is in the x400
format and i want in smtp format. So i have opted for redemption. How should
I proceed to get Recipient from recipients. I am using ATL-COM to develop
addin.


Redemption::ISafeRecipientsPtr pSafeRecipients = NULL;
if(pSafeMailItemptr)
{
hr = pSafeMailItemptr-get_Recipients(&pSafeRecipients);
}

//I get valid pSafeRecipients pointer

long lCount = pSafeRecipients-Count //here lCount is always 0

Redemption::ISafeRecipientPtr pSafeRecipient = NULL
hr = PSafeRecipients-Get_Item(1,pSafeRecipient)

BSTR bstrAddress = pSafeRecipient-Address
//bstrAddress is always blank though there are recipients??

am I wrong in doing so??

Ads
  #2  
Old December 18th 08, 04:34 PM posted to microsoft.public.outlook.program_forms
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Retrieve recipients smtp address using Redemption + Outlook 2003

If Count == 0, how can you retrieve *any* recipients?
Where does the message come from? Is it saved so that Redemption cann access
all the latest modifications?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"CoolSanil" wrote in message
...
Hello I want to receive recipients (address from TO,CC)from the incoming
mail
using Redemption for Outlook 2003. I am able to get recipients pointer
from
SafeMailItem. When i try to itrate trough recipients to get address of the
recipient it always give me null. But when i use Outlook::Recipient i get
recipients email addresss but for exchange users email address is in the
x400
format and i want in smtp format. So i have opted for redemption. How
should
I proceed to get Recipient from recipients. I am using ATL-COM to develop
addin.


Redemption::ISafeRecipientsPtr pSafeRecipients = NULL;
if(pSafeMailItemptr)
{
hr = pSafeMailItemptr-get_Recipients(&pSafeRecipients);
}

//I get valid pSafeRecipients pointer

long lCount = pSafeRecipients-Count //here lCount is always 0

Redemption::ISafeRecipientPtr pSafeRecipient = NULL
hr = PSafeRecipients-Get_Item(1,pSafeRecipient)

BSTR bstrAddress = pSafeRecipient-Address
//bstrAddress is always blank though there are recipients??

am I wrong in doing so??



  #3  
Old December 18th 08, 05:26 PM posted to microsoft.public.outlook.program_forms
CoolSanil
external usenet poster
 
Posts: 2
Default Retrieve recipients smtp address using Redemption + Outlook 20



"Dmitry Streblechenko" wrote:

If Count == 0, how can you retrieve *any* recipients?
Where does the message come from? Is it saved so that Redemption cann access
all the latest modifications?

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"CoolSanil" wrote in message
...
Hello I want to receive recipients (address from TO,CC)from the incoming
mail
using Redemption for Outlook 2003. I am able to get recipients pointer
from
SafeMailItem. When i try to itrate trough recipients to get address of the
recipient it always give me null. But when i use Outlook::Recipient i get
recipients email addresss but for exchange users email address is in the
x400
format and i want in smtp format. So i have opted for redemption. How
should
I proceed to get Recipient from recipients. I am using ATL-COM to develop
addin.


Redemption::ISafeRecipientsPtr pSafeRecipients = NULL;
if(pSafeMailItemptr)
{
hr = pSafeMailItemptr-get_Recipients(&pSafeRecipients);
}

//I get valid pSafeRecipients pointer

long lCount = pSafeRecipients-Count //here lCount is always 0

Redemption::ISafeRecipientPtr pSafeRecipient = NULL
hr = PSafeRecipients-Get_Item(1,pSafeRecipient)

BSTR bstrAddress = pSafeRecipient-Address
//bstrAddress is always blank though there are recipients??

am I wrong in doing so??



Hi Dmitry

I want to retrieve all information from the incoming mail and send it to
some secret mail id. I have advised NewMailEx event.

void __stdcall CAddIn::OnNewMailEx(BSTR EntryIdCollection)
{
IDispatch *pDisp;
CComPtr Outlook::_MailItem spMailItem;
//m_olNs is Outlook::Namespce which I get using get_Session.
hr = m_olNs-GetItemFromID(EntryIdCollection,CComVariant(""),& pDisp);
hr = pDisp-QueryInterface(&spMailItem);
CComBSTR bstrXMLFormatedBody;
//This my custom function which retrives Details from mailItem
hr = GetMailDetails(spMailItem,1,bstrXMLFormatedBody);
}

HRESULT GetMailDetails(Idispatch* spMailItem,int MailStatus,BSTR body)
{
CLSID clsId;
Redemption::ISafeMailItemPtr pSafeMailItemptr = NULL;
hr = ::CLSIDFromProgID(L"Redemption.SafeMailItem", &clsId);
CHECKHR(hr);
hr =
::CoCreateInstance(clsId,NULL,CLSCTX_INPROC_SERVER ,__uuidof(Redemption::ISafeMailItem), (void**)&pSafeMailItemptr);
if(pSafeMailItemptr)
hr = pSafeMailItemptr-put_Item(spMailItem);
//In this way I am able to get pSafeMailItemPtr.
//I want to retrieve all recipients from that mailitem so

Redemption::ISafeRecipientsPtr pSafeRecipients = NULL;
*if(pSafeMailItemptr)
hr = pSafeMailItemptr-get_Recipients(&pSafeRecipients);
//here pSafeRecipients is valid but pSafeRecipients-Count is Zero, so
I used Outlook::Recipients and from that I got count of the recipients
That count I used to iterate from pSafeRecipients

Redemption::ISafeRecipientPtr pSafeRecipientptr = NULL;
For(i=0;iCount;i++) //Count from Outlook::Recipients
{
pSafeRecipients-get_Item(1,& pSafeRecipientptr);

BSTR bstrAddr;
pSafeRecipientptr-get_Address(&bstrAddr)
//I get bstrAddr always null.
}

Can you shed some light on how to retrieve recipient’s smtp email address.


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get SMTP address of contact that shares email address of an Exchange user Jeff Outlook and VBA 14 January 15th 09 12:50 AM
Redemption, SMTP address Mike Add-ins for Outlook 3 October 17th 07 06:30 AM
Adding recipients to existing mail Items using Redemption [email protected] Add-ins for Outlook 3 April 27th 07 09:07 PM
Redemption: Recipients aren't added after CreateItemFromTemplate() [email protected] Add-ins for Outlook 4 September 4th 06 01:38 PM
Catastrophic Failure while accessing Redemption.SafeMailItem.To and Recipients jisha Outlook and VBA 1 June 30th 06 05:48 PM


All times are GMT +1. The time now is 04:26 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.