MarshallSoft Client Mailer Library For Visual FoxPro .

3y ago
29 Views
2 Downloads
384.29 KB
44 Pages
Last View : 2m ago
Last Download : 3m ago
Upload by : Ronnie Bonney
Transcription

MarshallSoft Client MailerLibrary for Visual FoxProReference Manual(MCM4FP)March 21, 2019Version 5.2This software is provided as-is.There are no warranties, expressed or implied.Copyright (C) 2019All rights reservedMarshallSoft Computing, Inc.Post Office Box 4543Huntsville AL 35815Email: info@marshallsoft.comWeb: www.marshallsoft.comMARSHALLSOFT is a registered trademark of MarshallSoft Computing.1

TABLE OF CONTENTS1 Introduction1.1 General Remarks1.2 MCM Files1.3 Documentation SetPagePagePagePage33332 MCM Functions2.1 mcmAttach2.2 mcmComputeCRC2.3 mcmGetError2.4 mcmGetInteger2.5 mcmGetInteger22.6 mcmGetLetterMacro2.7 mcmGetListMacro2.8 mcmGetString2.9 mcmGetString22.10 mcmKillProgram2.11 mcmLoadString2.12 mcmMakeStyled2.13 mcmMergeNext2.14 mcmMergeText2.15 mcmOpenBounce2.16 mcmOpenHeader2.17 mcmOpenLetter2.18 mcmOpenList2.19 mcmOpenReply2.20 mcmOpenSkip2.21 mcmPop3Close2.22 mcmPop3Connect2.23 mcmReadReply2.24 mcmRelease2.25 mcmSearch2.26 mcmSendMail2.27 mcmSetInteger2.28 mcmSetProxySSL2.29 mcmSetString2.30 mcmSleep2.31 mcmSmtpClose2.32 mcmSmtpConnect2.33 mcmStartProgram2.34 mcmStatistics2.35 mcmUtility2.36 2728293031323334353637383940413 MCM Error ListPage 422

1 IntroductionThe MarshallSoft Client Mailer for Visual FoxPro provides the capability to send personalized email toyour clients or customers directly from your Visual FoxPro application program. The “MarshallSoftClient Mailer for Visual FoxPro Reference Manual” contains details on each individual MCM function.The most current version of the MarshallSoft Client Mailer for Visual FoxPro can be found athttp://www.marshallsoft.com/mcm4fp.htm1.1 General RemarksThis is the reference manual for the Visual FoxPro version of the MarshallSoft Client Mailer (MCM). Thereare also versions of MCM for C/C , Visual Basic, Delphi, dBase, and Xbase . All versions employ theidentical MCM32.DLL differing only in documentation and example programs.All MarshallSoft Client Mailer (MCM) functions return an integer code. Negative values are always errors.Refer to Section 3.0 below, "MCM Error Return Code List". The file mcmErrors.txt contains a list of all errorcodes and their corresponding numerical value.Non-negative return codes are never errors. Note that the mcmErrorText function is used to get the textmessage associated with any error code.1.2 MCM Files (Visual FoxPro) mcm32con.foxmcm32fun.foxmcm32.dll*.prgMCM constants file.MCM function declaration file.32-bit MarshallSoft Client Mailer DLL.FoxPro example programs.3

1.3 Documentation SetThere are five manuals in Adobe PDF format for the MarshallSoft Client Mailer. Tutorial Manual: Introduces the basic functionality and overview of the MarshallSoft Client Mailer.Servers Manual: Covers background information on SMTP & POP3 servers.User Manual: Covers information that is not programming language specific (letter & list preparation,program logic, purchasing, performance, SSL, etc.).Reference Manual: Contains details for each individual MCM function specific for each programminglanguage (Visual FoxPro, Delphi, C/C , VB, etc.).Programmer Manual: Contains programming language (Visual FoxPro, Delphi, C/C , etc.) specificinformation such as compiling and running example programs.It is highly recommended that the tutorial manual be read first.The manuals can be found in the DOCS subdirectory/folder in the MarshallSoft Client Mailer file structurewhen it is installed. Note that for clarity purposes some information may have been provided in more than onemanual. Tutorial Manual:mcm tutorial.pdf or online athttp://www.marshallsoft.com/mcm tutorial.pdf. Servers Manual:mcm servers.pdf or online athttp://www.marshallsoft.com/mcm servers.pdf. User Manual:mcm users.pdf or online athttp://www.marshallsoft.com/mcm users.pdf. Reference Manuals mcm4fp reference.pdf oronline at http://www.marshallsoft.com/mcm4fp reference.pdf. Programmer Manuals mcm4fp programmer.pdf oronline at http://www.marshallsoft.com/mcm4fp programmer.pdf.Links to the above manuals can also be found online on the MarshallSoft Client Mailer for VisualFoxPro product pagehttp://www.marshallsoft.com/mcm4fp.htm4

2.0 MCM FunctionsAll MCM functions are declared in file MCM32FUN.FOX2.1 mcmAttach: Initialize MarshallSoft Client Mailer.SYNTAXDECLARE INTEGER mcmAttach in MCM32.DLL INTEGER KeyCode,INTEGEREditionCode,INTEGER ChansWanted,INTEGER DebugLevel,STRING @PathToMCMCode velPathToMCM:::::MCM key code (identifies purchaser)MCM edition code (no longer used)Maximum # channels requested.Debug level (0 OFF, 1 LOW, 2 HIGH)Pathname of files folder.REMARKSThe mcmAttach function initializes the Client-Mailer DLL (MCM32.DLL), passing the initializationparameters (1) KeyCode [0 for the evaluation version], (2) Edition Code [0 for the evaluation version], (3) themaximum number of channels to use when sending email, and (4) the debug level; 0 for no debug, 1 for low,and 2 for high, and (5) PathToMCM, the pathname of the log file folder.A keycode file (keycode.fox) containing the customer's keycode are included when MCM4FP is purchased.mcmAttach must be the first MarshallSoft Client Mailer (MCM) function called with the exception ofmcmUtility.RETURNSEvaluation: # days remaining in the evaluation (trial) period.Purchased: 999EXAMPLE CODEKeyCode 0EditionCode 0ChansWanted 24PathToMCM "c:\mcm4fp\apps"Code mcmAttach(KeyCode,EditionCode,Chanswanted,MCM DEBUG OFF,@PathToMCM)EXAMPLE PROGRAMSTestMCM, SendMail and GetReply5

2.2 mcmComputeCRC: Computes the CRC of a text buffer.SYNTAXDECLARE INTEGER mcmComputeCRC MCM32.DLL STRING @BufferCode mcmComputeCRC(@Buffer)Buffer : Text buffer.REMARKSThe mcmComputeCRC function is used to compute the CRC (using polynomial 1021 hex) of a nullterminated text string.RETURNSThe CRC of the characters in the null terminated buffer.EXAMPLE CODEText "Hello, world!"CRC mcmComputeCRC(Text)EXAMPLE PROGRAMSNone.6

2.3 mcmGetError: Get text associated with error code.SYNTAXDECLARE INTEGER mcmGetError in MCM32.DLL INTEGER ErrCode, STRING @Buffer,INTEGER BufLenCode mcmGetError(ErrCode, @Buffer, BufLen)ErrCode : (INTEGER) Error code.Buffer : (STRING) Error text buffer.BufLen : (INTEGER) Size of buffer.REMARKSThe mcmGetError function is used to copy the error text associated with the error code 'ErrCode' returned bya MCM function to the buffer, where it can be displayed by the calling program code.The size of the buffer should be 256 bytes.RETURNSReturn 0 : No such error.Return 0 : The number of bytes copied into the buffer.EXAMPLE CODEBuffer Space(256)if ErrCode 0* get MCM error messageCode mcmGetError(ErrCode, @Buffer, 255). . .EXAMPLE PROGRAMSSendMail and GetReply7

2.4 mcmGetInteger: Gets MCM processing information.SYNTAXDECLARE INTEGER mcmGetInteger in MCM32.DLL INTEGER ParmNameCode mcmGetInteger(ParmName)ParmName : (INTEGER) Parameter number.REMARKSThe mcmGetInteger function returns an integer whose value depends on the value of the passed parameter'ParamName' as follows.RETURNSMCM GET VERSION : The version of MCM in packed hexadecimal format (X.Y.Z)MCM GET VERSION 1ST PART : The first digit of the version of MCM.MCM GET VERSION 2ND PART : The second digit of the version of MCM.MCM GET VERSION 3RD PART : The third digit of the version of MCM.MCM GET BUILD : The build number of MCM.MCM GET LETTER LINE NBR : The current letter line just processed.MCM GET LETTER CHAR POS : The current character position on the current letter line.MCM GET LETTER MACROS : The number of macros (substitution strings) found in the letter.MCM GET LIST LINE NBR : The current list line just processed.MCM GET MAX LIST SIZE : The maximum number of entries allowed in the list of recipients.MCM GET MAX CHANNELS : The number of channels being used to send email.MCM GET CUSTOMER ID: The customer ID.MCM GET ALLOWED CHANNELS: The maximum allowed number of channels.MCM GET ALLOWED LIST SIZE: The maximum allowed list size.MCM GET ALLOWED SKIP FILES: The maximum allowed number o skip files.MCM GET ALLOWED REPLY FILES: The maximum number of reply files.MCM GET EDITION: The MCM edition (no longer used).MCM GET REGISTRATION: The customer registration string.8

MCM GET CHANNEL STATUS : The current channel status where each bit represents one channel.MCM GET EMAIL QUEUED COUNT : The number of emails queued to be sent.MCM GET EMAIL SENT COUNT : The number of emails successfully sent.MCM GET EMAIL ERROR COUNT : The number of emails queued but not sent due to errors.MCM GET LIST LINES : The number of lines in the list file.MCM GET LETTER LINES : The number of lines in the letter file.MCM GET SKIP LINES : The number of lines in last skip file loaded.MCM GET LIST MACRO COUNT : The number of macros (substitution strings) in the recipient list.MCM GET LIST DELIMITER : The macro (substitution string) delimiter. This will be either the comma,semicolon, tab, carrot , or tilde .MCM GET LIST ERROR STRING : The line number of last error in the recipient list.MCM GET SKIP FILE LIMIT : The maximum number of skip files allowed.MCM GET REPLY FILE LIMIT : The maximum number of reply files allowed.EXAMPLE CODE? "Customer ID is " Str(mcmGetInteger(MCM GET CUSTOMER ID))EXAMPLE PROGRAMSendMail9

2.5 mcmGetInteger2: Get information for macro processing.SYNTAXDECLARE INTEGER mcmGetInteger2 in MCM32.DLL INTEGER ParmName, INTEGERSelectedCode mcmGetInteger2(ParmName, Selected)ParamName : (INTEGER) Parameter number.Selected : (INTEGER) Selection number for ParamName.REMARKSThe mcmGetInteger2 function returns an integer value corresponding to the passed parameters 'ParamName'and 'Selected'.RETURNSMCM GET LETTER MACRO LINE : Get the line on which the 'Selected' macro appears.EXAMPLE CODE* get macro string i (1,2,3,.)Buffer Space(256)Code mcmGetLetterMacro(i, @Buffer, 255)if Code 0* find line in letter on which macro # i occursCode mcmGetInteger2(MCM GET LETTER MACRO LINE, i)? "Macro " Buffer " defined on line " Str(Code)EXAMPLE PROGRAMS(none)10

2.6 mcmGetLetterMacro: Get Macro Substitution String in LetterSYNTAXDECLARE INTEGER mcmGetLetterMacro in MCM32.DLL INTEGER MacroNumber, STRING@Buffer, INTEGER BufSizeCode mcmGetLetterMacro(MacroNumber, @Buffer, BufSize )MacroNumber : (INTEGER) Macro number (1,2,.)Buffer: (STRING) Macro buffer.BufSize: (INTEGER) Size of buffer.REMARKSThe mcmGetLetterMacro returns the macro (substitution string) in the letter associated with the macronumber (1,2,3,.). Macros may be up to 40 characters in length. The first macro in a letter is #1, the second is#2, etc.For example, consider the letter as shown in section 2.12 mcmOpenLetter. The first macro in the letter is"%EmailAddress%, the second is %Fullname%, etc.RETURNSReturn 0 : The line number (in the letter) on which macro appears.Return 0 : The error code MCM NO SUCH MACRO.EXAMPLE CODE* get macro string i (1,2,3,.)Buffer Space(256)Code mcmGetLetterMacro(i, @Buffer, 255)if Code 0* find line in letter on which macro # i occursCode mcmGetInteger2(MCM GET LETTER MACRO LINE, i)? "Macro " Buffer " defined on line " Str(Code)EXAMPLE PROGRAMS(none)ALSO SEEmcmGetListMacro11

2.7 mcmGetListMacro: Get Macro Substitution String in Recipient ListSYNTAXDECLARE INTEGER mcmGetListMacro in MCM32.DLL INTEGER MacroNumber, STRING@Buffer, INTEGER BufSizeCode mcmGetListMacro(MacroNumber, @Buffer, BufSize)MacroNumber : (INTEGER) Macro number (1,2,.)Buffer: (STRING) Macro buffer.BufSize: (INTEGER) Size of buffer.REMARKSThe mcmGetListMacro returns the macro (substitution string) in the recipient list associated with the macronumber (1,2,3,.). Macros may be up to 40 characters in length, and are defined on the first line of the list.For example, consider the recipient list as shown in section 2.13 mcmOpenList. There are three macros(always appearing on the first line) in the list. The first macro is %EmailAddress%, the second is%AppointmentTime%, and the third is %Fullname%.mcmGetListMacro is called by the application code that sends the email such as the SendMail exampleprogram.RETURNSReturn 0 : The macro index.Return 0 : The error code MCM NO SUCH MACRO.EXAMPLE CODE* get list macro i (1,2,3,.)Buffer Space(256)Code mcmGetListMacro (i, @Buffer, 255)if Code 0? "Macro " BufferEXAMPLE PROGRAMS(none)ALSO SEEmcmGetLetterMacro12

2.8 mcmGetString: Gets string parameter for MCM processing.SYNTAXDECLARE INTEGER mcmGetString in MCM32.DLL INTEGER ParamName, STRING@Buffer, INTEGER BufSizeCode mcmGetString(ParamName, @Buffer, BufSize)ParamName : (INTEGER) Parameter numberBuffer: (STRING) String buffer.BufSize: (INTEGER) Size of buffer.REMARKSThe mcmGetString function returns a string which contents depends on the value of the passed parameter'ParamName' as follows. Note that MCM reads only the headers of incoming email.MCM GET VERSION : Copies the MCM version string into 'Buffer'.MCM GET LETTER : Copies the entire letter into 'Buffer'. Requires SMTP connection.MCM GET SUBJECT : Copies the letter subject into 'Buffer'. Requires SMTP connection.MCM GET BODY : Copies the body of the letter into 'Buffer'. Requires SMTP connection.MCM GET FROM : Copies the "From:" address into 'Buffer'. Requires SMTP connection.MCM GET TIME STAMP : Copies the current date & time string into 'Buffer'.MCM GET LAST EMAIL SENT : Copies address of last email sent into 'Buffer'.MCM GET RECIPIENT : Copies email address of last recipient.RETURNSThe number of characters copied.EXAMPLE CODEWork Space(4096)Code mcmGetString(MCM GET LETTER, @Work, 4095)if Code 0? WorkEXAMPLE PROGRAMSSendMail and GetReplyALSO SEEmcmGetInteger and mcmGetInteger213

2.9 mcmGetString2: Gets string parameter for MCM processing.SYNTAXCode XmcmGetString2(ParmName, Selection, @Buffer, BufSize)ParmName :Selection:Buffer:BufSize :(INTEGER) Parameter number(INTEGER) Selection index (1,2,.)(STRING) String buffer.(INTEGER) Size of buffer.REMARKSThe mcmGetString2 function returns a string which contents depends on the value of the passed parameter'ParamName' as follows. Note that MCM reads only the headers of incoming email.MCM GET BOUNCE STRING : Copies the selected 'bounce' string into 'Buffer'. The bounce string musthave been previously set by mcmSetString(MCM ADD BOUNCE STRING, String).Bounce strings are numbered 1,2,.RETURNSThe number of characters copied.EXAMPLE CODEWork Space(256)Code mcmGetString(MCM GET BOUNCE STRING, 1, @Work, 255)if Code 0EXAMPLE PROGRAMSGetReplyALSO SEEmcmGetString, mcmGetInteger, and mcmGetInteger214

2.10 mcmKillProgram: Terminates External Program.SYNTAXDECLARE INTEGER mcmKillProgram in MCM32.DLL INTEGER ProcessID,INTEGER ExitCodeCode mcmKillProgram(ProcessID, ExitCode)ProcessID : (I) Process ID (returned from mcmStartProgram)ExitCode : (P) Exit code.REMARKSThe mcmKillProgram function kills (terminates) the external program (process) that was started bymcmStartProgram, where the ProcessID was returned by mcmStartProgram.RETURNS Return 0 : Cannot kill program.EXAMPLES* kill program (ProcessID returned from mcmStartProgram)Code mcmKillProgram(ProcessID, 0)EXAMPLE PROGRAMSNone.ALSO SEEmcmStartProgram15

2.11 mcmLoadString: Load substitution string.SYNTAXDECLARE INTEGER mcmLoadString in MCM32.DLL STRING @StringKey, STRING@StringTextCode mcmLoadString(StringKey, StringText)StringKey : (STRING) String key.StringText : (STRING) String text.REMARKSThe mcmLoadString loads the substitution string for advanced macros.Note: Advanced macros have not been implemented yet.RETURNS 0 : Error (see Section 3.0 MCM Error List) 0 : No errorEXAMPLE CODE(none)EXAMPLE PROGRAMS(none)16

2.12 mcmMakeStyled: Make Styled File.SYNTAXDECLARE INTEGER mcmMakeStyled in MCM32.DLL STRING @TextFile,STRING @FontList, INTEGER SizeCode,STRING @HtmlLine, INTEGER lename of ASCII text file to be converted.List of fonts.HTML size.URL of tracking image file.(reserved)REMARKSThe mcmMakeStyled function creates a HTML formatted email message file from a ASCII email messagefile. The created HTML filename is the text filename with “.htm” appended to it.The primary purpose for the mcmMakeStyled function is to enable tracking when a particular email isopened. See the section “Email Tracking” in the MCM User’s Manual (mcm users.pdf).The font list is the list of preferred fonts, as for example "Arial, Helvetica".The size code is the HTML size parameters. Pass 0 to specify the default size, which normally corresponds tosize 3.The HtmlLine is the URL of the image file used for tracking , as for example:"https://mcm-user.000webhostapp.com/mcm counter.php?DATE 030419 CID 000100"The Flags parameter is not used in this version (5.2) of MCM.RETURNS 0 : Error (see Section 3.0 MCM Error List) 0 : No errorEXAMPLE CODETextFile "Letter.txt"FontList "Arial, Helvetica"HtmlLine https://mcmuser.000webhostapp.com/mcm counter.php?DATE 030419 CID 000100Code mcmMakeStyled(@TextFile, @FontList, 3, @HtmlLine, 0)EXAMPLE PROGRAMMakeStyled.prg17

2.13 mcmMergeNext: Merge next recipient for sending.SYNTAXDECLARE INTEGER mcmMergeNext in MCM32.DLLCode mcmMergeNext()REMARKSThe mcmMergeNext function merges the next recipient from the recipient list with the loaded letter inpreparation for sending.See the mcmMergeText function for a list of the merge codes.mcmMergeNext is called by the application code that sends the email such as the SendMail exampleprogram.RETURNS -1 Error (see Section 3.0 MCM Error List) -1 End-of-file (MCM EOF) 0 OK to send 0 Don't send (see mcmMergeText)EXAMPLE CODE* send letter to each recipientfor I 1 To 1000* merge letter with next recipientMergeCode mcmMergeNext()EXAMPLE PROGRAMSGetReplyALSO SEEmcmMergeText18

2.14 mcmMergeText: Get text for associated merge code.SYNTAXDECLARE INTEGER mcmMergeText in MCM32.DLL INTEGER MergeCode, STRING@Buffer, INTEGER BufSizeCode mcmMergeText(MergeCode, @Buffer, BufSize)MergeCode : (INTEGER) Merge code.Buffer: (STRING) String buffer.BufSize: (INTEGER) Size of buffer.REMARKSThe mcmMergeText function copies the merge code text corresponding with the numerical 'MergeCode' to'Buffer' so that it can be displayed by the calling application program.Recall that if the value returned by the mcmMergeNext function (called the "merge code") is positive, thenemail should not be sent to this particular recipient. The numerical values of the merge codes are listed inmcm32con.fox and include:MCM MERGE INVALID ADDRESS : Invalid email addressMCM MERGE DUPLICATE ADDRESS : Duplicate email addressMCM MERGE BRACKETS NOT ALLOWED : ' ' and ' ' not allowed in email addressMCM MERGE CANNOT OPEN ATTACH : Cannot open attachmentMCM MERGE UNKNOWN CHARSET : Unknown character setMCM MERGE EMTY MACRO STRING : Empty macro string found in recipient list.In addition, merge codes between 1 and 24 indicate that the email address was found in a skip (exclusion) list:MergeCode 1 : Email address was found in skip list #1.MergeCode 24 : Email address was found in skip list #24mcmMergeText is called by the application code that sends the email such as the SendMail example program.RETURNSNumber of characters copied to 'Buffer'.EXAMPLE CODEBuffer Space(256)if MergeCode 0Code mcmMergeText(MergeCode, @Buffer, 255)? BufferEXAMPLE PROGRAMSGetReplyALSO SEEmcmMergeNext and mcmOpenSkip19

2.15 mcmOpenBounce: Open bounce file for processing.SYNTAXDECLARE INTEGER mcmOpenBounce in MCM32.DLL STRING @PathNameCode mcmOpenBounce(@PathName)PathName : (STRING) Pathname of bounce file.REMARKSThe mcmOpenBounce opens the "bounce" file into which are written (when checking for client replies) theemail addresses that have b

4 1.3 Documentation Set There are five manuals in Adobe PDF format for the MarshallSoft Client Mailer. Tutorial Manual: Introduces the basic functionality and overview of the MarshallSoft Client Mailer. Servers Manual: Covers background information on SMTP & POP3 servers. User Manual: Covers information that is not programming language specific (letter & list preparation,

Related Documents:

4 1.3 Documentation Set There are five manuals in Adobe PDF format for the MarshallSoft Client Mailer. Tutorial Manual: Introduces the basic functionality and overview of the MarshallSoft Client Mailer. Servers Manual: Covers background information on SMTP & POP3 servers. User Manual: Covers information that is not programming language specific (letter & list preparation,

The Act requires a slate mailer organization that sends a slate mailer, as defined in Chapter 1, to include specific disclaimers as part of the mailer. This chapter describes the information that must be provided in a slate mailer. A Notice to Voters A slate mailer organization that produces a slate mailer must include

6 x 9" POSTCARD. 6 x 11" POSTCARD. 6. ⅛ x 12 ⅛" SELF-MAILER. 8 x 14" SELF-MAILER. 8½ x 11" SELF-MAILER. 8½ x 14" SELF-MAILER. 10½ x 17" SELF-MAILER. REAL RESULTS Throughout this book, ROI results are shown for previous customers who ran a campa

Bruksanvisning för bilstereo . Bruksanvisning for bilstereo . Instrukcja obsługi samochodowego odtwarzacza stereo . Operating Instructions for Car Stereo . 610-104 . SV . Bruksanvisning i original

10 tips och tricks för att lyckas med ert sap-projekt 20 SAPSANYTT 2/2015 De flesta projektledare känner säkert till Cobb’s paradox. Martin Cobb verkade som CIO för sekretariatet för Treasury Board of Canada 1995 då han ställde frågan

service i Norge och Finland drivs inom ramen för ett enskilt företag (NRK. 1 och Yleisradio), fin ns det i Sverige tre: Ett för tv (Sveriges Television , SVT ), ett för radio (Sveriges Radio , SR ) och ett för utbildnings program (Sveriges Utbildningsradio, UR, vilket till följd av sin begränsade storlek inte återfinns bland de 25 största

Hotell För hotell anges de tre klasserna A/B, C och D. Det betyder att den "normala" standarden C är acceptabel men att motiven för en högre standard är starka. Ljudklass C motsvarar de tidigare normkraven för hotell, ljudklass A/B motsvarar kraven för moderna hotell med hög standard och ljudklass D kan användas vid

Tank 6 API-653 In-Service, Internal Inspection Report less severe corrosion than the west perimeter. The average thickness of the sketch plates away from the west perimeter was 0.281”. Other than the perimeter corrosion noted, the remainder of the tank bottom showed no signs of significant metal loss and the thickness readings appeared consistent with the readings from the 2004 robotic .