How do I add an X- header to an outgoing email

I want to be able to tag autoreplies with an X header to identify them as such. I have tried adding one as a MIME Header, but it gets stripped out when mailed.Here’s the code:-

m_Session.ConvertMime = False

If doc.hasitem(“SMTPOriginator”) Then ’ …it came from the Internet, so reply needs to be tagged

Dim bodyMIME As NotesMimeEntity

Dim header As NotesMimeHeader

Set bodyMIME = Me.m_noteEmail.getMIMEEntity

If bodyMIME Is Nothing Then

    Set bodyMIME = Me.m_noteEmail.CreateMIMEEntity

End If

Set header = bodyMIME.CreateHeader("X-IOP-AutoReply")

Call header.SetHeaderVal("True")

Call Me.m_noteEmail.CloseMIMEEntities(True)

End If

Me.m_noteEmail.Send (False)

m_Session.ConvertMime = True

Anyone?

Subject: How do I add an X- header to an outgoing email

I have not used the R6 MIME classes. But in R5, whenever I wanted to add a custom header (X-field), or send a multipart mail msg with html , file attachments, etc, I ended up using Java and interfacing directly with the smtp port to build the mail message.

I’d be interested to know if you get this working in LotusScript.

Subject: Solved: How do I add an X- header to an outgoing email

There needs to be a field set on the Server Configuration document of your mail server.

Under “MIME/Advanced/Advanced Outbound Message Options” there is a field “Always send the following Notes items in headers”. Set it to the name of your field, minus the “X-”, and then add that field to your memo document, either in Design or with LS. Whatever text value you put in the field will be the X-Header value.

e.g. Set the above field to “Autoreply” then use doc.ReplaceItemValue(“AutoReply”, “True”) in the Out-Of-Office agent to tag autoreplies with:-

X-AutoReply: True

Subject: RE: Solved: How do I add an X- header to an outgoing email

Nice idea. I searched Google for “X-AutoReply” and found some references to:X-AutoReply: Yes

but not

X-AutoReply: True

Is there a standard? Or do you think mail routers simply check for the field’s existence?