Postie and Message-ID

Started by atlanta1213, April 24, 2014, 07:28:05 AM

Previous topic - Next topic

atlanta1213

Is there a way to set the Message-ID in the mail header when using Postie?

Deana

Try appending desired header line to the subject line after a @CRLF. For Example:

Code (winbatch) Select
AddExtender("WWPST44I.DLL")

strSubject="How to add Message-ID header"

; A common technique used by many message systems is to use a time and date stamp along with the local host's domain name, e.g., 950124.162336@example.com
strMsgid = TimeJulianDay( TimeYmdHms() ):'@winbatch.com'
strHeader = "Message-ID:  " : strMsgid
strSubjectHeader = strSubject:@CRLF:strHeader

kInit("mail.sample.com","me@sample.com","","","")
kDest("you@sample.com","","")
bResult = kSendText(strSubjectHeader,"How to add Message-ID header using Postie. Check my header.","","")
If bResult
   Message("Message","Sent")
Else
   Message("Error",kStatusInfo())
EndIf


Reference: http://en.wikipedia.org/wiki/Message-ID
Deana F.
Technical Support
Wilson WindowWare Inc.

atlanta1213

Thanks so much for that information.  One question though, the message id created (for today) using that method is just the Julian day of 735714. Any tips on how I can get somehting specific down to the second?

Deana

Quote from: atlanta1213 on April 25, 2014, 06:33:55 AM
Thanks so much for that information.  One question though, the message id created (for today) using that method is just the Julian day of 735714. Any tips on how I can get somehting specific down to the second?

See TimeYmdhms. Maybe something like:

Code (winbatch) Select
strMsgid = StrReplace( TimeYmdHms(), ':', ''):'@winbatch.com'
Deana F.
Technical Support
Wilson WindowWare Inc.