Hi All,
I'm using a vanilla M$ vbscriptM$ that stamps outgoing emails from our company with a disclaimer on our mail exchange mail server. The problem I have is, when someone gets in a convo with someone outside, the disclaimer is added everytime it's replying back out to. It's okay but would prefer if it only stamped it once and ignored the script if the email had the disclaimer content already.
Here's the script
<SCRIPT LANGUAGE="VBScript">
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)
TextDisclaimer = vbCrLf & "DISCLAIMER:" & vbCrLf & "Sample Disclaimer added in a VBScript."
HTMLDisclaimer = "<p></p><p>DISCLAIMER:<br>Sample Disclaimer added in a VBScript."
If Msg.HTMLBody <> "" Then
'Search for the "</body>" tag and insert our disclaimer 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>
Be great if somewhere in the script it could be added if disclaimer exists in email, goto end or something. It may already be their, just need a pointer if so or code to be added to this effect.
Hope someone can help, many thanks.
Edzy55..........
I'm using a vanilla M$ vbscriptM$ that stamps outgoing emails from our company with a disclaimer on our mail exchange mail server. The problem I have is, when someone gets in a convo with someone outside, the disclaimer is added everytime it's replying back out to. It's okay but would prefer if it only stamped it once and ignored the script if the email had the disclaimer content already.
Here's the script
<SCRIPT LANGUAGE="VBScript">
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus)
TextDisclaimer = vbCrLf & "DISCLAIMER:" & vbCrLf & "Sample Disclaimer added in a VBScript."
HTMLDisclaimer = "<p></p><p>DISCLAIMER:<br>Sample Disclaimer added in a VBScript."
If Msg.HTMLBody <> "" Then
'Search for the "</body>" tag and insert our disclaimer 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>
Be great if somewhere in the script it could be added if disclaimer exists in email, goto end or something. It may already be their, just need a pointer if so or code to be added to this effect.
Hope someone can help, many thanks.
Edzy55..........