Jump to content

Exchange 2003 Disclaimer mit Eventsink


Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte erstelle einen neuen Beitrag zu Deiner Anfrage!

Recommended Posts

Posted

Hallo, ich habe nach der AnleitungHow to add a disclaimer to outgoing SMTP messages in Visual Basic script einen Disclaimer anlegen wollen. Irgendwie funktioniert das aber nicht. Ich habe

 

<SCRIPT LANGUAGE="VBScript">

Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)

TextDisclaimer = vbCrLf & "DISCLAIMER:"Mein Text"

HTMLDisclaimer = "<p></p><p>DISCLAIMER:<br>Mein Text"

 

If Msg.HTMLBody <> "" Then

'Search for the "</body>" tag and insert our discliamer before that tag.

pos = InStr(1, Msg.HTMLBody, "</body>", vbTextCompare)

szPartI = Left(Msg.HTMLBody, pos - 1)

szPartII = Right(Msg.HTMLBody, Len(Msg.HTMLBody) - (pos - 1))

Msg.HTMLBody = szPartI + HTMLDisclaimer + szPartII

End If

 

If Msg.TextBody <> "" Then

Msg.TextBody = Msg.TextBody & vbCrLf & TextDisclaimer & vbCrLf

End If

 

'Commit the content changes to the transport ADO Stream object.

Msg.DataSource.Save ' Commit the changes into the transport Stream

 

EventStatus = cdoRunNextSink

End Sub

</SCRIPT>

 

als Eventsinkscript.vbs unter c:\ gespeichert.

 

Dann habe ich in der Konsole folgendes ausgeführt:

 

 

cscript smtpreg.vbs /add 1 onarrival SMTPScriptingHost CDO.SS_SMTPOnArrivalSink "mail from=*"

Antwort:

Microsoft ® Windows Script Host, Version 5.6

Copyright © Microsoft Corporation 1996-2001. Alle Rechte vorbehalten.

 

assigning priority (31010 of 32767)

registered SMTPScriptingHost

 

cscript smtpreg.vbs /setprop 1 onarrival SMTPScriptingHost Sink ScriptName "C:\EventSinkScript.vbs"

 

Antwort:

Microsoft ® Windows Script Host, Version 5.6

Copyright © Microsoft Corporation 1996-2001. Alle Rechte vorbehalten.

 

set property ScriptName to C:\EventSinkScript.vbs

 

Das Müsste es doch dann gewesen sein?

Jetzt greife ich mit Mapi/OWA/SMTP/RPCoverHTTPS zu und versende Mails, doch leider sehe ich keinen Disclaimer.

 

Hat jemand eine Idee?

Danke

Der letzte Beitrag zu diesem Thema ist mehr als 180 Tage alt. Bitte erstelle einen neuen Beitrag zu Deiner Anfrage!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...