MikeKellner 10 Posted August 7, 2006 Report Posted August 7, 2006 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 Quote
weg5st0 10 Posted August 7, 2006 Report Posted August 7, 2006 Siehe hier - MSXFAQ.DE - EventDisclaimer einfügen Abschnitt MAPI Clients. Sollte dir helfen. Quote
MikeKellner 10 Posted August 7, 2006 Author Report Posted August 7, 2006 Mapi ist mir klar das es nicht funktioniert, aber was ist mit dem Rest? Quote
MikeKellner 10 Posted August 7, 2006 Author Report Posted August 7, 2006 Ich habe ein OL Client auf POP3/Smtp konfiguriert und darüber Mails verschickt. Da ist kein Disclaimer drin. Quote
weg5st0 10 Posted August 7, 2006 Report Posted August 7, 2006 Prüf mal mit dem Skript von hier: MSXFAQ.DE - SMTP-EventSink ob dein Sink wirklich erfolgreich registriert ist. Hast du die Mail per SMTP an einen externen Empfänger gesendet? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.