Alvaro
Guest
|
Posted:
Tue Jan 25, 2005 2:47 pm Post subject:
ExchEventSink from problem |
|
|
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
|
|
Mario Kropik
Guest
|
Posted:
Tue Jan 25, 2005 4:01 pm Post subject:
Re: ExchEventSink from problem |
|
|
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
|
|
|