ITSPMDDE - "IT Solutions'" Pegasus Mail DDE Send Mail Extension Things to note: 1) service/application name is "ITSPMDDE"; topic name is "SENDMAIL" 2) all messages in section 2 of wpmforms.h are implemented, except "QUICKADDRESS" 3) name of each message is generally same as defined name without preceding "WM_F_" 4) the exceptions to 3) are the attachment messages and the header messages 5) "NEWMESSAGE", "SETDEFAULTS" and "SENDMESSAGE" are implemented as DDE-Executes, the rest as DDE-Pokes 6) poked data must be in CF_TEXT (normal ASCII) format, others will not be processed; this should not be a problem: normally if an application pokes in a rejected format, it will try again with a different format until it finds the one that works, here CF_TEXT 7) if present, all CR and LF characters will be chopped off the end of received execute or poke data; some applications add a CR/LF sequence automatically to the end of CF_TEXT data 8) the exceptions to 7) are MESSAGETEXT and SETHEADER pokes, in which case each CR, LF, CR/LF or LF/CR sequence in the data is converted into a single LF 9) all messages are buffered internally by ITSPMDDE until "SENDMESSAGE" is sent 10) "NEWMESSAGE" clears any buffered messages from ITSPMDDE 11) except for "NEWMESSAGE" and "SENDMESSAGE", messages can be sent in any order 12) sending any message a second time overwrites what was sent the first time 13) the exceptions to 11) and 12) are the attachment messages 14) up to 64 attachments are allowed; each attachment consists of an "ATTACHFILE" message, followed by optional "ATTACHTYPE" and "ATTACHENCODING" messages; if an attachment type or encoding is desired for a file, it must be specified explicitly each time 15) the header messages are "SETHEADERTYPE" and "SETHEADER" 16) messages which take a WORD/BOOL value should have the desired value in a character string representation; "0" for false or 0, "1" for true or 1, "2" for 2, etc. 17) the value for the "EXPIRATION" message should be a digit string of the form "YYMMDDhhmmss"; all 12 digits must be present 18) when the ITSPMDDE extension is present, there will be a logging dialog present in the WinPMail window; closing or ending this dialog will disable the extension; you can minimize it, if it bothers you 19) relevant events will be logged in the logging dialog in a push-down manner; the top line is the newest log entry, the bottom line the oldest 20) in log entries where user data is shown, non-printable characters are represented by question marks; displayed user data is truncated at 80 characters 21) if you compile and use the debug version, then you need to specify an output destination for DebugOutputString() output in the OutPutTo= entry of the [debug] section of your system.ini 22) software and source copyright "IT Solutions" GmbH, but released under GNU GPL (copyleft) Here are example statements in WordBasic: channel = DDEInitiate("ITSPMDDE", "SENDMAIL") DDEExecute channel, "NEWMESSAGE" DDEExecute channel, "SETDEFAULTS" DDEPoke channel, "TO", "walkerj@noexist.de" DDEPoke channel, "CC", "foo, bar, baz" DDEPoke channel, "BCC", "chief" DDEPoke channel, "SUBJECT", "Test message subject" DDEPoke channel, "COPYSELF", "1" DDEPoke channel, "CONFIRMREADING", "0" DDEPoke channel, "CONFIRMDELIVERY", "1" DDEPoke channel, "URGENT", "0" DDEPoke channel, "MIME", "1" DDEPoke channel, "8BITDATA", "0" DDEPoke channel, "REPLYTO", "me@company.com" DDEPoke channel, "ATTACHFILE", "c:\pmail\attach.xls" DDEPoke channel, "ATTACHTYPE", "not sure what goes in here" DDEPoke channel, "ATTACHENCODING", "3" DDEPoke channel, "ENCRYPTIONKEY", "abcdef" DDEPoke channel, "NOSIG", "1" DDEPoke channel, "MESSAGEFILE", "c:\pmail\test.txt" DDEPoke channel, "MESSAGETEXT", "Or, your can send the text like this.\n" DDEPoke channel, "EXPIRATION", "961125123010" DDEPoke channel, "SETHEADERTYPE", "0" DDEPoke channel, "SETHEADER", "X-Test: ITSPMDDE\n" DDEExecute channel, "SENDMESSAGE" DDETerminate channel