ExchEventSink from problem
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
ExchEventSink from problem

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





Posted: Tue Jan 25, 2005 2:47 pm    Post subject: ExchEventSink from problem Reply with quote

Hi,
I put a c# dll in the exchange server listen a mailbox with the command
regevent.vbs add "onsave;ondelete" MyEventSink.ExchEventSink ...
When a mail arrives in the mailbox the dll runs and I get the mail with
this code:
....
CDO.Message iMessage=new CDO.MessageClass();
iMessage.DataSource.Open(bstrURLItem,null,
ADODB.ConnectModeEnum.adModeRead,
ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
ADODB.RecordOpenOptionsEnum.adOpenSource,"","");

subject= iMessage.Subject;
remitente = iMessage.From;
corpo = iMessage.TextBody;
....
but I have a Problem with the from property. I am using active directory and
outlook 2003 and exchange server 2003
When the user that send the email have in the active directory the name to
see Rodríguez González, Alvaro
I receive in the from property this:
Rodríguez González <Rodríguez González>, Alvaro
<alvaro.rodriguez.gonzalez@parlamentodegalicia.es>
That is worn, the sender is only one user.

When I put in the name to see in the active directory
Rodríguez González Alvaro (without colon)
I receive in the from property this:
Rodríguez González Alvaro <alvaro.rodriguez.gonzalez@parlamentodegalicia.es>
To reply the email I need this.

Any ideas how can I resolve this problem? I need the colon in the active
directory.

Thanks a lot
Alvaro
MCAD .net
Galiza

Back to top
Mario Kropik
Guest





Posted: Tue Jan 25, 2005 4:01 pm    Post subject: Re: ExchEventSink from problem Reply with quote

Hi Alvaro,

use urn:schemas:httpmail:frommail property. So you can immediatly read the
sender's smtp address.

You don't need to use CDO's Message object. Just open an ADODB.Record with
the URL bstURLItem.
Then read the propertys using Record's Fields Collection.

e.g.
Dim rec as new adodb.record
rec.open bstrURLItem, ,adModeRead, ad FailIfNotExists
SendersEmail = rec.fields("urn:schemas:httpmail:frommail property").value
.....
read other properties
......
rec.close

Perhaps CDO Message object also supports a "frommail" property. I don't
know...

Mario


"Alvaro" <Alvaro@discussions.microsoft.com> schrieb im Newsbeitrag
news:630D59D6-93C8-49F9-AC32-384DCC388021@microsoft.com...
Quote:
Hi,
I put a c# dll in the exchange server listen a mailbox with the command
regevent.vbs add "onsave;ondelete" MyEventSink.ExchEventSink ...
When a mail arrives in the mailbox the dll runs and I get the mail with
this code:
...
CDO.Message iMessage=new CDO.MessageClass();
iMessage.DataSource.Open(bstrURLItem,null,
ADODB.ConnectModeEnum.adModeRead,
ADODB.RecordCreateOptionsEnum.adFailIfNotExists,
ADODB.RecordOpenOptionsEnum.adOpenSource,"","");

subject= iMessage.Subject;
remitente = iMessage.From;
corpo = iMessage.TextBody;
...
but I have a Problem with the from property. I am using active directory
and
outlook 2003 and exchange server 2003
When the user that send the email have in the active directory the name to
see Rodríguez González, Alvaro
I receive in the from property this:
Rodríguez González <Rodríguez González>, Alvaro
alvaro.rodriguez.gonzalez@parlamentodegalicia.es
That is worn, the sender is only one user.

When I put in the name to see in the active directory
Rodríguez González Alvaro (without colon)
I receive in the from property this:
Rodríguez González Alvaro
alvaro.rodriguez.gonzalez@parlamentodegalicia.es
To reply the email I need this.

Any ideas how can I resolve this problem? I need the colon in the active
directory.

Thanks a lot
Alvaro
MCAD .net
Galiza


Back to top
 
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




Windows Server Dedicated Servers
Contact Us
New Topics Powered by phpBB