I'm having a problem getting oMessage.HeaderValue("Subject") to update when I want it to. I'm using the OnAcceptMessage event to set it, and within the subroutine, it accepts it, but when the message comes down in the mail, it shows the original subject.
For testing purposes, all I'm doing is adding "[HM]" to the front of the subject.
If I modify the header within the subroutine and use it within the text of the reply message, the reply message shows the change, so I know I'm updating it at that point at least. Authenticating didn't help, and I've also tried passing the oMessage object ByRef into the subroutine to see if it was a scoping issue, but that didn't help either.
Here is the code:
This really seems pretty basic. Any idea what I'm missing?
Sub OnAcceptMessage(oClient, oMessage)
' modify the subject
oMessage.HeaderValue("Subject")="[HM] " & oMessage.HeaderValue("Subject")
' check if too many attachments
If oMessage.Attachments.Count > 5 Then
Result.Value = 2
Result.Message = "We have a five attachment limit for Subject: " & oMessage.HeaderValue("Subject") & " coming from " & oClient.IPAddress
Else
Result.Value = 0
End If
End Sub
Regards,
John