![]() |
Home Email me SEARCH |
Adeleida
Alan Bell
Alan Lepofsky
Andy Donaldson
Arne Nielsen
Ben Langhinrichs
Ben Poole
Bill Buchan
BlogSphere
Brian Benz
Bruce Elgort
Captain Oblivious
Carl Tyler
Chris Byrne
Chris Coates
Chris Linfoot
Chris Miller
Chris Toohey
Chris Whisonant
Christian Brandlehner
CodeStore
Craig Schumann
Curt Stone
Damien Katz
Declan Lynch
Devin Olson
DomBlog.de
domlike.net
Duffbert
Ed Brill
Fabian Nirman
Ferdy Christant
Gayle Elgort
Grant Bingham
Gregg Eldred
Hassan Voyeau
Heini Schwammerl
Ian Irving
Jack Dausman
Jens-Christian Fischer
Jerry Carter
Johan Känngård
John Mill
John Roling
John Vaughan
Just Enough Governance
Justin Knol
Kathy Sierra
Keith Strickland
Ken Yee
Kevin Pettitt
Kurt Higley
Lance Spellman
Laurette Rynne
Mac Guidera
Matt and Jess
Matt White
Mikkel Heisterberg
Mrs Elsmore
Nathan Freeman
News4Notes
nsftools
OpenNTF Blog
Paul Mooney
PhotoTechno Reflections
Ray Bilyk
Richard Schwartz
Richard Spense
Rob Novak
Rob Wunderlich
Rocky Oliver
Roy Holder
Scott Good
Sean Burgess
Simon Peek
Squirrelly Notes
Stan Rogers
Stephan H. Wissel
Steve Castledine
Susan Bulloch
Taking Notes
Tim Rynne
Tim Tripcony
Tom's Rant
Turtle
Vince Schuurman
Volker Weber
Warren Elsmore
A gent with whom I used to work emailed another former cohort and me with this request:
Either of you smart boys know how to add a custom X header to an e-mail sent from a Domino client? I want to add a header as a flag for a third party SMTP relay to recognize and process.
I am useless on my own :-) ...so anyone have the answer?
1. Posted by Josh Humphrey09/09/2007 08:42 PM
this is slightly modified from the Help, only works in ND6 or greater... the X header is called X-The-Dude
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim body As NotesMIMEEntity
Dim header As NotesMIMEHeader
Dim child As NotesMIMEEntity
Dim stream As NotesStream
Set db = s.CurrentDatabase
s.ConvertMIME = False ' Retain MIME format
Set doc = db.CreateDocument
REM Create parent entity
Set body = doc.CreateMIMEEntity
Set header = body.CreateHeader("Content-Type")
Call header.SetHeaderVal("multipart/mixed")
Set header = body.CreateHeader("Subject")
Call header.SetHeaderVal("MIME multipart message")
Set header = body.CreateHeader("To")
Call header.SetHeaderVal("""Charlie Brown"" <c.brown@peanuts.com>")
Set header = body.CreateHeader("X-The-Dude")
Call header.SetHeaderVal("Donny, these men are nihilists. There's nothing to be afraid of.")
Set stream = s.CreateStream
REM Create first child entity
Set child = body.CreateChildEntity
Call stream.WriteText("Text of message for child 1." _
& Chr(10) & Chr(10))
Call child.SetContentFromText(stream, "text/plain", _
ENC_QUOTED_PRINTABLE)
Call stream.Truncate
REM Create second child entity
Set child = body.CreateChildEntity
Call stream.WriteText("Text of message for child 2.")
Call child.SetContentFromText(stream, "text/plain", _
ENC_QUOTED_PRINTABLE)
Call doc.send(False)
s.ConvertMIME = True ' Restore conversion
2. Posted by Joe Litton - website09/09/2007 08:42 PM
Josh, you ROCK! Your next La Ideal lunch is on me 
3. Posted by Stephan H. Wissel - website09/09/2007 08:42 PM
Hi Rock, hi Josh,
the solution is quite compelling. However if the task is to flag ALL outgoing mail you need to come up with something else/additional. We're using Group Anti-Virus and they provide a hook to apply code to all messages in the mail.box of the server. There you can easily add X-the-dude
. The only change to the code: get the existing header instead of creating new mime. Again: ND6 required
stw











