Home
SEE Reference Manual (all languages)
Contents
1. Parameter Name Value SEE ADDRESS DELIMITER semicolon SEE_ALLOW_8BITS O FALSE SEE_ATTACH_DELIMITER semicolon SEE_ATTACH_BASE_NUMBER O FALSE SEE_AUTHENTICATE_PROTOCOL 1 CRAM MD5 authentication SEE AUTO CALL DRIVER 1 TRUE SEE BLOCKING MODE T SEE_CONNECT_WAIT 60000 SEE_DECODE_UNNAMED 0 FALSE SEE_ENABLE_APOP 0 FALSE SEE_ENABLE_ESMTP 0 FALSE SEE_ENABLE_IMAGE 1 TRUE SEE_FILE_PREFIX 0 FALSE SEE_FORCE_INLINE 0 FALSE SEE_GUT_ATTACHMENTS O FALSE SEE_HIDE_HEADERS 0 FALSE SEE_HIDE_SAVED_MSG O FALSE SEE_HIDE_TO_ADDR 0 FALSE SEE_IGNORE_REJECTED 0 FALSE SEE_IMAP_PORT 143 SEE_KEEP_RFC822_INTACT O FALSE SEE_MAX_LINE_LENGTH 76 SEE MAX RESPONSE WAI 25000 SEE_MIN_RESPONSE_WAI 250 SEE_PATH_DELIMITER semicolon SEE_POP3_PORT LLO SEE_QUOTED_PRINTABLE 0 FALSE SEE_RAW_MODE O FALSE SEE_REPLACE_UNDERSCORES 1 TRUE SEE_REPLACE_WITH_COMMAS 1 TRUE SEE_SET_CONNECT_ATTEMPTS 5 SEE_SE RAWFILE PREFIX E 0 SEE_SLEEP_TI 50 SEE_SMTP_PORT 25 SEE_WRITE_CONTENT_TYPE O FALSE SEE_WSACLEANUP 1 TRUE 46 SEE_ADDRESS_DELIMITER sets the delimiter to use for separating multiple email addresses SEE_ALLOW_8BITS will allow 8 bit data inside an email message Note that 7 bit ASCII is the RFC822 standard Not recommended SEE ATTACH BASE NUMBER sets the first numeric value to be used as the prefix for attachments Use 0 to not prefix attachment fil
2. BASIC Example DIM SearchArgs As String SearchArgs LARGER 10000 NOT SEEN Code seeImapSearch 0 SearchArgs Buffer 128 ALSO REFER TO ImapSearch example program 43 2 37 seelmapSelectMB Selects IMAP mailbox SYNTAX seeImapSelectMB Chan Mailbox Chan TI Channel 0p ida sad Mailbox P Name of mailbox to select REMARKS The seeImapSelectMB function is used to select a mailbox MB for processing The standard inbox is InBox The seeImapSelectMB function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example char SavedBox 128 strepy char SavedBox SavedBox Code seeImapSelectMB 0 SavedBox BASIC Example Dim SavedBox As String SavedBox SavedBox Code seeImapSelectMB 0 SavedBox 44 2 38 seelmapSource Specified file from which to read IMAP email SYNTAX seeImapSource Chan ImapFilename Chan I Channel number Filename P IMAP filename REMARKS The seelmapSource function is used to specify the path to a file containing an undecoded email After calling this function seeGetEmailFile can be called to decode the email as if it were being downloaded from an IMAP server Note that there is no IMAP connection The email is read directly from a file The seeImapSource function is used with IMAP servers only RETURNS e Return lt 0 An error
3. EXAMPLES C C Example get UID string for email message 1 char Buffer 256 n seeGetEmailUID 0 1 char Buffer 256 BASIC Example get UID string for email message 1 Dim Buffer As String 256 n seeGetEmailUID 0 1 Buffer 256 ALSO REFER TO seeGetEmailCount STATUS example program 31 2 25 seeGetHeader Get Header SYNTAX seeGetHeader Chan Param Chan I Channel number Param I Parameter see below Buffer P Pointer to Buffer Size I Size of buffer REMARKS The seeGetHeader function returns the selected header once an email has been read Parameter Description SEE_GET_DATE Get Date header SEE_GET_FROM Get From header SEE_GET_REPLY_TO Get Reply To header SEE GET SUBJECT Get Subject header SEE GET TO Get To header RETURNS e Return gt 0 The number of character in the returned header e Return 1 Parameter is not recognized EXAMPLES C C Example char Buffer 256 get Subject header Code seeGetHeader 0 SEE GET SUBJECT char Buffer 255 if Code gt 0 printf Subject s n Buffer BASIC Example Dim Buffer As String get Subject header Buffer SPACE 256 Code seeGetHeader 0 SEE GET SUBJECT Buffer 255 32 2 26 seeGetTicks Get System Ticks SYNTAX seeGetTicks Divisor Divisor I Divisor REMARKS The seeGetTicks function returns the number of mill
4. SYNTAX seeDecodeBuffer CodedPtr ClearPtr Length CodedPtr P Buffer of base 64 coded chars ClearPtr P Buffer to put decoded bytes Length I Length of above buffer REMARKS The seeDecodeBuffer function decodes the buffer CodedPtr of length Length into ClearPtr returning the length in ClearPtr The buffer CodedPtr MUST contain base 64 encoded text as created by seeEncodeBuffer The buffer ClearPtr will contain the ASCII or binary data that was encoded RETURNS e Return gt 0 Number of bytes copied to ClearPtr e Return lt 0 An error has occurred See Section 3 SEE Error Return Code List EXAMPLES C C Example BASE64 decode coded buffer char CodedBuffer TWFyc2hhbGxTb2Z0 char ClearBuffer 50 CodedLength strlen CodedBuffer ClearLength seeDecodeBuffer CodedBuffer ClearBuffer CodedLength BASIC Example BASE64 decode coded buffer CodedBuffer TWFyc2hhbGxTb2Z0 ClearBuffer Space 50 CodedLength LEN CodedBuffer ClearLength seeDecodeBuffer CodedBuffer ClearBuffer CodedLength ALSO REFER TO seeEncodeBuffer CodeTest example program 16 2 10 seeDecodeUTF8 Decode UTF encoded string SYNTAX seeDecodeUTF8 UTF8Buffer UnicodeBuffer UTF8Buffer P Buffer for UTF8 string UnicodeBuffer P Pointer to buffer for 16 bit Unicode character REMARKS The seeDecodeUTES function is used to decode a UTF8 s
5. 27 2 21 seeGetEmailFile Read email message and save to a file SYNTAX seeGetEmailFile Chan MsgNbr EmailName EmailDir AttachDir Chan Channel number I MsgNbr I Messag EmailName P Email filename P P EmailDir Directory for email AttachDir Directory for attachments REMARKS The seeGetEmailFile reads the email message MsgNbr saving it to disk as filename EmailName in directory EmailDir and saving MIME attachments to directory AttachDir The current directory is specified as Be sure that the specified directories exist before calling this function Use to specify the current directory Also note that an older file of the same name as the newer file will be overwritten An undecoded copy of the email being downloaded can be saved to disk by calling seeIntegerParam Chan SEE_SET_RAWFILE_PREFIX prefix char before calling seeGetEmailFile For example if the prefix character is the underscore _ and the filename passed to seeGetEmailFile is mail txt then the undecoded copy will be named mail txt The seeGetEmailFile function is used with POP3 and IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example char FileName Email4 txt char EmailDir SEE4C APPS char AttachDir SEE4C APPS Code seeGetEmailFile 0 4 char FileNa
6. Attach Chr 0 Code seeSendEmail 0 To CC BCC Subject Message Attach ALSO REFER TO seeSendHTML MAILER example program 59 2 49 seeSendHTML Sends HTML encoded email and attachments SYNTAX seesendHTML Chan To CC BCC Subject Message Images AltText Attach Chan I Channel number To P Recipient separated by semi colons CC P CC list separated by semi colons BCC P BCC list separated by semi colons Subject P Subject text HTML P HTML message text or filename Images P List of embedded images AltText P Alternate text Attach P File attachment list REMARKS The seeSendHTML function is used to send HTML encoded email See the entry for seeSendEmail for an explanation of the To CC and BCC fields If the first character of the message 6th argument or alternate text 8th argument is a Q then it is considered as the filename which contains the message to send The Images field contains the filenames of images that are to be embedded in the email message The first image must be referenced in the text of the HTML encode email message as lt IMG SRC cid message root 1 gt The second image if any must be referenced as lt IMG SRC cid message root 2 gt Continue in this way for all embedded images AltText is used to provide a plain ASCII text equivalent of the message for those email clients that cannot decode HTML A
7. The file ERRORS TXT contains a list of all error codes and their corresponding numeric value RETURNS e Return gt 0 Length of text message copied into Buffer e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example get text associated with ErrCode char Buffer 80 Code seeErrorText 0 ErrCode char Buffer 80 BASIC Example get text associated with ErrCode Dim Buffer As String 80 Code seeErrorText 0 ErrCode Buffer 80 Most example programs call seeErrorText 23 2 17 seeExtractLine Extract specified line from buffer SYNTAX seeExtractline Src Line Buffer BufSize Sre P Text buffer to search Line I Line number 1 2 wanted Buffer P Buffer for line if found BufSize I Size of Buffer REMARKS The seeExtractLine function is used to extract line Line from buffer Src If the specified line number is found then the entire line up to a maximum of BufSize bytes is copied to Buffer The primary purpose of seeExtractLine is to extract header lines by line number from the buffer after calling seeGetEmailLines Recall that all lines returned by seeGetEmailLines are terminated by a carriage return linefeed pair Lines are numbered from 1 rather than 0 The seeExtractLine does not require a connection to an SMTP or POP3 server RETURNS e Return gt 0 Number of bytes placed in Buff
8. bill ImapPass abc Code seeImapConnect 0 ImapHost ImapUser ImapPass ALSO REFER TO seeImapConnectSSL 34 2 28 seelmapConnectSSL Connects to IMAP Server with SSL SYNTAX seeImapConnectSSL Chan ProxyPort ImapPort ImapServer ImapUser ImapPass ProxyIP Chan I Channel number ProxyPort I Port to connect to proxy on ImapPort I IMAP port normally 993 ImapServer P IMAP server name ImapUser P Sender s email address ImapPass P Reply To header ProxyIP P Host name or IP address of proxy server REMARKS The seelmapConnectSSL function is used to connect to an IMAP server with SSL Note that seeSetProxySSL must be called before calling seelmapConnectSSL ProxyPort can be an unused port ImapPort for SSL will normally be 993 ImapServer is the name or IP address of the IMAP server ImapUser is the user name and ImapPass is the password ProxyIP is the host name or IP address of the proxy server Pass NULL or an empty string to specify this computer 127 0 0 1 Stunnel must first be installed seelmapComnectSSL will automatically start and stop Stunnel as needed To set up Stunnel see Using Stunnel in the SEE User s Manual SEE_USR PDF or online at http www marshallsoft com stunnel htm RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example connect to IMAP server imap gmail com char ImapServer imap gmail com
9. Example execute next state Code seeDriver 0 BASIC Example execute next state Code seeDriver 0 ALSO REFER TO seeIntegerParam seeSmtpConnect and seePop3Connect READER example program 20 2 14 seeEncodeBuffer Encodes buffer using base64 SYNTAX seeEncodeBuffer ClearBuf CodedBuf Length ClearBuf P Buffer of characters to encode CodedBuf P Buffer to put base 64 encoded Length I Length of above REMARKS The seeEncodeBuffer function encodes ClearBuf into CodedBuf using Base 64 encoding The ClearBuf buffer may contain any ASCII or binary data The CodedBuf buffer will contain 7 bit ASCII data broken into lines of 76 characters followed by a carriage return hex OD and line feed hex OA That is CodedBuf will contain multiple lines RETURNS e Return gt 0 Number of bytes copied to CodedBuf e Return lt 0 An error has occurred See section 3 SEE Error Return Code List C C Example BASE64 encode buffer char ClearBuffer MarshallSoft char CodedBuffer 50 ClearLength strlen CodedBuffer CodedLength seeEncodeBuffer ClearBuffer CodedBuffer ClearLength BASIC Example BASE64 encode buffer ClearBuffer MarshallSoft r n CodedBuffer SpaceS 50 ClearLength LEN ClearBuffer CodedLength seeEncodeBuffer ClearBuffer CodedBuffer ClearLength ALSO REFER TO seeQuoteBuffer and the CODESTES
10. Code seePop3Source 0 Source ALSO REFER TO seePop3Connect POP3RD example program 54 2 45 seeQuoteBuffer Constructs ISO 8859 String SYNTAX seeQuoteBuffer String Buffer BufLen String P ISO 8859 text Buffer P Buffer for 150 8859 encoded string Buflen I Size of above buffer REMARKS The seeQuoteBuffer function creates an ISO 8859 encoded string in Buffer from the ISO 8859 8 bit character ISO 8859 text in String The buffer length 3 parameter should be twice the size of the length of the string 1 parameter The primary use for the seeQuoteBuffer function is in constructing ISO 8859 compliant Subject headers The default delimiter used to separate email addresses and path names was changed from a comma to a semi colon in Version 3 6 of SEE RETURNS e Return gt 0 The number of characters copied to Buffer e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example construct quoted subject string identifying it as quoted iso 8859 1 char Text Ce message est crit en francais char Buffer 128 Code seeQuoteBuffer char Text char Buffer 128 BASIC Example construct quoted subject string identifying it as quoted iso 8859 1 Dim Text As String Dim Buffer As Buffer Text Ce messag st crit en francais Buffer Space 128 Code seeQuoteBuffer Text Buffer 128 ALSO REFER TO seeUnQuo
11. User BillyBob gmail com char Pass sorry char From lt BillyBob gmail com gt char Reply Code seeSmtpConnectSSL 0 8801 465 Server User Pass From Reply NULL BASIC Example connect to SMTP server smtp gmail com via port 8801 Server smtp gmail com User BillyBob gmail com Pass sorry From lt BillyBob gmail com gt Reply Chr 0 Code seeSmtpConnectSSL 0 8801 465 Server User Pass From Reply Chr 0 68 2 56 seeSmtpTarget Specifies SMTP output file SYNTAX seeSmtpTarget FileName EmailAddr ReplyAddr FileName I File to write SMTP output to EmailAddr 1 Return email address ReplyAddr 1 Reply To address REMARKS seeSmtpTarget is called instead of seeSmtpConnect so that when seeSendEmail or seeSendHTML is called the email is written to the specified file in RFC822 compliant format rather than sent to the server seeSmtpTarget is called instead of seeSmtpConnect RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example Code seeSmtpTarget 0 char MyFile txt char lt you yourisp com gt char lt youltyourisp com gt BASIC Example Code seeSmtpTarget 0 MyFile txt lt you yourisp com gt lt you yourisp com gt ALSO REFER TO seePop3Source 69 2 57 seeStartProgram Starts External Program SYNTAX seeStartProgram Commandline CommandLine I Co
12. char ImapUser bill gmail com char ImapPass abc Code seeImapConnectSSL 0 8803 993 InapServer ImapUser ImapPass NULL BASIC Example connect to IMAP server imap gmail com Dim ImapHost ImapUser ImapPass As String ImapServer imap gmail com ImapUser bill gmail com ImapPass abc Code seeImapConnectSSL 0 8803 993 ImapServer ImapUser ImapPass Chr 0 ALSO REFER TO seeImapConnect 35 2 29 seelmapCopyMBmail Copy messages to specified mailbox SYNTAX seeImapCopyMBmail Chan Message Mailbox Chan E Channel 405 7 dy 2 sa Message I Message number to copy 1 2 Mailbox P Name of destination mailbox Note seeImapCopyMBmail is a copy to not a copy from REMARKS The seelmapCopyMBmail function is used to copy messages from the selected mailbox to the specified mailbox That is an email message is copied from the currently selected mailbox to the mailbox specified by the argument Mailbox The seelmapCopyMBmail function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example char SavedBox 128 strcpy char SavedBox SavedBox Code seeImapCopyMBmail 0 7 SavedBox BASIC Example Dim SavedBox As String SavedBox SavedBox Code seeImapCopyMBmail 0 7 SavedBox 36 2 30 seelmapCreateMB Create a new mailbox SYNTAX seeImapCreateMB Chan
13. 0 char lt info yourisp com gt char NULL char NULL char Test char Forwarding test Email2Forward BASIC Example forward undecoded email file Email2Forward to lt info yourisp com gt To lt info yourisp com gt CC Chr 0 BCC Chr 0 Subject Test Message Forwarding test Code seeForwardEmail 0 To CC BCC Subject Message Email2Forward Refer to the FORWARD example program ALSO REFER TO seeGetEmailFile FORWARD example program 26 2 20 seeGetEmailCount Get number of email messages on server SYNTAX seeGetEmailCount Chan Chan I Channel number REMARKS The seeGetEmailCount function returns the number of messages waiting on the server independent of whether they have been previously read If you have disabled the driver AUTO_CALL capability the message count must be found by calling seeStatistics 0 SEE GET MSG COUNT after calling seeDriver until it returns 0 The seeGetEmailCount function is used with POP3 and IMAP servers only RETURNS e Return gt 0 The number of email messages waiting e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example get messages waiting on server NbrMsg seeGetEmailCount 0 BASIC Example get messages waiting on server NbrMsg seeGetEmailCount 0 ALSO REFER TO seeGetEmailLines STATUS example program
14. 47 seeRelease Releases SEE SYNTAX seeRelease REMARKS The seeRelease function releases the SEE system SeeRelease is called only once and should be the very last SEE function called seeClose should be called for all channels before calling seeRelease RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example release SEE seeRelease BASIC Example release SEE Code seeRelease Most of the example programs call seeRelease ALSO REFER TO seeAttach 57 2 48 seeSendEmail Sends email and attachments SYNTAX seesSendEmail Chan To CC BCC Subj Msg Attach Chan I Channel number To P Recipient separated by semi colons CC P CC list separated by semi colons BCC P BCC list separated by semi colons Subj P Subject text Msg P Message or message filenam P Attach File attachment list REMARKS The seeSendEmail function is used to send email once a connection has been made to your SMTP server after calling seeSmtpConnect Note that all email addresses in To CC and BCC strings must be bracketed and the CC and BCC strings may contain multiple email addresses separated by semi colons For example lt info marshallsoft com gt Billy Bob lt bbob isp com gt Buster lt bm isp com gt If the first character of the message sixth argument is a then it is considered as the filena
15. I Size of above buffer should be gt 256 bytes REMARKS The seeTestFileSet function is used to verify that each file in the comma or semicolon delimited list of files can be opened for read access This function provides an easy way to test that message and attachment files exist and can be opened by SEE If all the files in the string FileSet can be opened then seeTestFileSet returns a 0 Otherwise the filename of the first file that cannot be opened is copied to Buffer and the length of the filename is returned Filenames in FileSet must be separated by either commas or semicolons RETURNS 0 All files can be opened gt 0 Length of filename in Buffer that cannot be opened EXAMPLES C C Example int Code char Buffer 256 char FileSet c see4c apps imagel gif c see4c apps image2 gif Code seeTestFileSet FileSet char Buffer 256 if Code gt 0 printf s cannot be opened n Buffer BASIC Example Dim Code As Integer Dim Buffer As String Dim FileSet As String FileSet c see4vb apps imagel gif c see4vb apps image2 gif Buffer Space 256 Code seeTestFileSet FileSet Buffer 256 If Code gt 0 Then Buffer Left Buffer Code MsgBox Buffer cannot be opened 75 2 61 seeUnquoteBuffer Unquote Buffer SYNTAX seeUnquoteBuf fer SrcBuffer DstBuffer DstLength SrcBuffer P Source string to unquote DstBuffer P Destination buffer DstLength I S
16. Mailbox Chan I Channel 0 1 2 Mailbox P Name of mailbox to create REMARKS The seelmapCreateMB function is used to create a new mailbox MB Once created mail can be transferred between the new mailbox the InBox and any other previously created mailbox The seelmapCreateMB function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example char SavedBox 128 strcpy char SavedBox SavedBox Code seeImapCreateMB 0 SavedBox BASIC Example Dim SavedBox As String SavedBox SavedBox Code seeImapCreateMB 0 SavedBox 37 2 31 seelmapDeleteMB Delete a mailbox SYNTAX seeIlmapDeleteMB Chan Mailbox Chan I Channel 04 1 2y s Mailbox P Name of mailbox to delete REMARKS The seelmapDeleteMB function is used to delete a mailbox MB previously created However the InBox cannot be deleted The seelmapDeleteMB function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example char SavedBox 128 strcpy char SavedBox SavedBox Code seeImapDeleteMB 0 SavedBox BASIC Example Dim SavedBox As String SavedBox SavedBox Code seeImapDeleteMB 0 SavedBox 38 2 32 seeImapFlags Get set or delete IMAP message flags SYNTAX seeImapFlags Chan MsgNbr Command FlagsMa
17. best way to learn how a function is called is to find it used in one of the example programs 1 5 1 C C C NET C If you will be using SEE with C C and another language order the C C version SEE works with Visual C Borland C C Borland C Builder Watcom C C LCC Visual C NET and Visual C NET through Visual Studio 2013 1 5 2 Delphi Functions defined in the Delphi Unit SEEW PAS begin with f rather than see SEE works all version of Delphi from Delphi 2 through Delphi 2010 and Delphi XE XE7 1 5 3 Visual Basic SEE works with all version of Visual Basic including VB NET and Visual Basic for Applications VBA 1 5 4 PowerBASIC Constants defined for PowerBASIC SEE32 PBI begin with the character symbol SEE works with PBCC PBDLL and PBWIN 1 5 5 Visual FoxPro All strings passed to SEE functions must be prefixed with the character SEE works with all versions of 32 bit Visual FoxPro 1 5 6 Visual dBase SEE works with all versions of Visual dBase 1 5 7 Xbase Functions defined for Xbase begin with X All strings passed to SEE functions must be prefixed with the character SEE works with all versions of Alaska Xbase 1 5 8 COBOL SEE4CB supports Fujitsu COBOL but we also have a few example programs for other COBOL compilers such as ACUCOBOL Micro Focus COBOL Realia COBOL and RM COBOL 1 5 9 Fortran We have example programs for ABSOFT Salford Compaq Visual Fortran and Digit
18. etc that cannot statically allocate memory Refer to the SMTP POP3 IMAP Email Programmer s Manual The seeGetEmailLines function is used with POP3 and IMAP servers only RETURNS e Return gt 0 The number of bytes read e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example read email message 5 headers only w o decoding char Buffer 10000 Code seeGetEmailLines 0 5 0 char Buffer 10000 BASIC Example read email message 5 headers only w o decoding Dim Buffer As String 10000 Code seeGetEmailLines 0 5 0 Buffer 10000 ALSO REFER TO seeGetEmailFile STATUS example program 29 2 23 seeGetEmailSize Get size of email message in bytes SYNTAX seeGetEmailSize Chan MsgNbr Chan I Channel number MsgNbr I Message number REMARKS The seeGetEmailSize function returns the size in bytes of the specified message MsgNbr seeGetEmailSize returns the size of the entire email message including any attachments Note that attachments will be encoded MIME UUENCODE etc and thus take up more room than after they are decoded If you have disabled the driver AUTO_CALL capability the size must be found by calling seeStatistics 0 SEE_GET_MSG_SIZE after calling seeDriver until it returns 0 The seeGetEmailSize function is used with POP3 and IMAP servers only RETURNS e Return gt 0 The size of the email in bytes o
19. has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example decode email file char Source c see4c apps raw_email txt Code seeImapSource 0 char Source BASIC Example decode email file Dim Source As String Source c see4c apps raw_email txt Code seeImapSource 0 Source ALSO REFER TO seeImapConnect and the POP3PRD example program 45 2 39 seeIntegerParam Sets numeric parameter to control email processing SYNTAX seeIntegerParam Chan ParamIndex ParamValue Chan I Channel number ParamIndex I Parameter nam s below ParamValue L Value of parameter to set REMARKS The seeIntegerParam function is used to set an integer parameter that is passed to the SEE library to provide additional control of email processing The numeric value for each of the integer parameters is defined in the SEE declaration files Section 1 3 Declaration Files provides a list the Declaration Files All times are in milliseconds Defaults values are as follows
20. registered DLL The keycode is O for the evaluation version Refer to file KEYCODE RETURNS e Return lt 0 An error has occurred See Section 3 SEE Error Return Code List EXAMPLES All example programs call seeAttach C C Example Initialize SEE look in KEYCODE H for SEE KEY CODE seeAttach 1 SEE_KEY_CODE BASIC Example Initialize SEE look in KEYCODE BAS for SEE KEY CODE Code seeAttach 1 SEE KEY CODE ALSO REFER TO seeSmtpConnect seePop3Connect 2 3 seeAttachmentParams Specifies attachment Content Type headers SYNTAX seeAttachmentParams ContentType Encoding Disposition Description ContentType P Content Type header Encoding P Content Transfer Encoding header Disposition P Content Disposition header Description P Content Description header REMARKS This function specifies the Content Type headers for up to the first 5 attachments Additional attachments if any use the standard default headers Passing a NULL or an empty string to any one of the four parameters sets that parameter to the default value application octet stream The purpose of this function is to enable the creation of specific types of multi part MIME parts For example specifying Content Type audio x wav sets the Content Type of the attachment file to audio WAV that w
21. 4 byte integer L 4 byte integer P 4 byte pointer Refer to the declaration files see Section 1 3 below for the exact syntax of each SEE function Also note that the example programs show exactly how SEE functions are called 1 2 SEE Arguments Only variables previously declared in your program should be passed to SEE functions as is demonstrated in the example programs Text strings passed to SEE functions must be terminated by a null character since SEE calls Windows API functions that require null terminated strings 1 3 Documentation Set The complete set of documentation consists of three manuals in Adobe PDF format This is the third manual SEE_REF PDF in the set e SEE 4x Programmer s Manual SEE_4x PDF e SEE User s Manual SEE USR PDF e SEE Reference Manual SEE REF PDF The SMTP POP3 IMAP Programmer s Manual SEE 4x PDF is the programming language dependent manual and provides information needed to compile your programs as well as the examples in the specified environment The x in SEE 4x PDF Programmer s Manual specifies the host language such as C for C C VB for Visual Basic etc The SMTP POP3 IMAP User s Manual SEE USR PDF discusses language independent SMTP POP3 IMAP email processing issues License and purchase information is also provided The SMTP POP3 IMAP Reference Manual SEE REF PDF contains details on each individual SEE functi
22. CHED SEE_CHAN_OUT_OF_RANGE SEE BAD KEY CODE SEE NO SUCH FILE SEE PATH NOT ALLOWED SEE NO SUCH PATH SEE IMAP ERROR SEE IMAP ONLY SEE POP3 IMAP ONLY SEE IMAP FLAG ERROR SEE IMAP SEARCH ERROR SEE BUFFER OVERFLOW SEE PROXY START FAILS SEE PROXY NOT CONFIGURED SEE NO SUCH OPTION SEE EXPIRED SEE INTERNAL ERROR Must call seeAttach first seeAttach already called Channel number out of range Bad keycode 2nd argument in seeAttach No such file Filename only path not allowed No such path IMAP returned error IMAP function ONLY POP3 or IMAP function ONLY IMAP flag error IMAP search error Buffer overflow Could not start proxy server Proxy server not configured No such option Evaluation version expired Internal SEE error 80
23. CII characters The buffer must be null terminated last character is a hex 00 and the buffer must be at least twice the size in bytes of the character string since 16 bit characters require twice the space as 8 bit characters This function is only necessary when working with 16 bit Unicode ASCII characters in C and Delphi NET RETURNS e Length of the string in characters EXAMPLES C C Example See C example CODETEST int Code char AsciiString Marshal1SoftY0NO0MO0NONONONONONONONONO Convert 8 bit ASCII string to 16 bit ASCII Code seeByteToShort char AsciiString ALSO SEE seeShortToByte 10 2 5 seeClose Closes connection opened by SEE SYNTAX seeClose Chan Chan 1 Channel number REMARKS The seeClose function closes the connection created by calling seeSmtpConnect seePop3Connect seeSmtpConnectSSL seePop3ConnectSSL seeImapConnect or seelmapConnect Call seeClose to terminate the connection before connecting again If the connect function fails do not call seeClose since the connection is already closed RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example close connection to server seeClose 0 BASIC Example seeClose 0 Code seeClose 0 ALSO REFER TO seeSmtpConnect seePop3Connect seeSmtpConnectSSL seePop3ConnectSSL All example programs call seeClose 11 2 6 seeCommand Transmits us
24. ETRAW example program SEE_WRITE_TO_LOG is used to write text to the LOG file SEE_SET_CONTENT_TYPE_PREFIX specifies a string that is prefixed to the Content Type header line that is written to the email output file POP3 connection provided that SEE_WRITE_CONTENT_TYPE is set to TRUE SEE_SET_FILE_PREFIX is used to specify the character default value that is used to specify in the seeSendEmail function that the message text is a filename rather than the actual text of the email message Pass an empty string null character to disable message text is never a filename SEE_SET_FOOTER is used to append footer text up to 256 chars to all outgoing email SEE_SET_HELO_STRING is used to set a custom HELO EHLO string used when connecting to a SMTP server RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example specify SEE log file name char LogFile log txt Code seeStringParam 0 SEE LOG FILE char LogFile BASIC Example specify SEE log file name Dim LogFile As String LogFile log txt Code seeStringParam 0 SEE_LOG_FILE LogFile ALSO REFER TO seeIntegerParam 74 2 60 seeTestFileSet Test Files for Existence SYNTAX seeTestFileSet FileSet Buffer BufLen FileSet P List of files to test Buffer P Buffer for filename if it cannot be opened Buflen
25. IP This feature should always be used unless you are downloading to a directory specifically for downloaded attachments Pass an integer gt 1 to specify the first prefix SEE_FORCE_INLINE specifies if text attachments are inline or not Possible values are INLINE_TEXT_OFF 0 not forced inline INLINE_TEXT_INLINE 1 text attachments coded inline or INLINE_TEXT_ATTACHMENT 2 text attachments attached as file SEE_GUT_ATTACHMENTS specifies that the contents of all attachments should be removed Pass 1 to enable 0 to disable default SEE_HIDE_HEADERS causes headers such as From Subject etc to not be written to the email output file This flag overrides any conflicting flags SEE HIDE SAVED MSG is used to hide the Attachment saved to message in incoming email SEE_HIDE_TO_ADDR is used to hide the To field in outgoing email 47 SEE_IGNORE_REJECTED directs SEE to ignore error returned if recipient is rejected SEE_IMAP_PORT changes the IMAP port SEE_KEEP_RFC822_INTACT causes SEE to keep RFC822 messages intact not decoded when downloaded The RFC822 message will be saved to disk as a text attachment SEE_MAX_LINE_LENGTH specifies the maximum length of the lines sent to the SMTP server Note that the RFC822 standard specifies 76 characters SEE_MAX_RESPONSE_WAIT is the time after which a timeout error occurs if the server has not responded SEE_MIN_RESPONSE_WAIT is the delay before looking for
26. LER BCAST STATUS examples 72 2 59 seeStringParam Sets SEE string parameter to control email processing SYNTAX seeStringParam Chan ParamName ParamString Chan I Channel number ParamName I Parameter ParamString P Parameter string REMARKS The seeStringParam is used to set an string text parameter that is passed to the SEE library The numeric value for each of the integer parameters is defined in the SEE declaration files Section 1 3 Declaration Files provides a list the Declaration Files SEE_ADD_HEADER Adds header SEE LOG FILE Specifies the log filename SEE SET 0 NT TYPE Sets user defined content SEE SET CONTENT TYPE PREFIX Write prefix to Content Type header SEE SET FILE PREFIX Specifies file prefix character SEE SET FRO Sets From header after connecting SEE SET HEADER Sets header line SEE SET IMAP LIST ARG Species the IMAP list command SEE SET REPLY Sets the Reply To string SEE SET SECRET Sets password for SMTP authentication SEE SET TRANSFER ENCODING Sets user defined transfer encoding SEE SET USER Sets user for SMTP authentication SEE WRITE BUFFER Writes internal buffer to disk SEE WRITE TO LOG Write string to LOG file SEE SET FOOTER Append footer to a
27. Pop3Host Pop3User Pop3Pass As String Pop3Host mail yourisp com Pop3User bill Pop3Pass abc Code seePop3Connect 0 Pop3Host Pop3User Pop3Pass ALSO REFER TO seeSmtpConnect and seeClose STATUS and READER example programs 52 2 43 seePop3ComnectSSL Connects to POP3 Server with SSL SYNTAX seePop3ConnectSSL Chan ProxyPort Pop3Port Pop3Server Pop3User Pop3Pass ProxyIP Chan I Channel number ProxyPort I Proxy port to contact proxy on Pop3Port I POP3 port normally 995 Pop3Server P POP3 Server name Pop3User P POP3 user name Pop3Pass P POP3 password ProxyIP P Host name or IP address of proxy server REMARKS The seePop3ConnectSSL function is used to connect to a POP3 server with SSL Note that seePop3ConnectSSL uses the same arguments as seelmapConnectSSL ProxyPort can be an unused port Pop3Port variable will normally be 995 Pop3Server is the name or IP address of the POP3 server Pop3User is the user name and Pop3Pass is the password ProxyIP is the host name or IP address of the proxy server Pass NULL or an empty string to specify this computer 127 0 0 1 seeSetProxySSL must be called before calling seePop3ConnectSSL Stunnel must first be installed seePop3ConnectSSL will automatically start and stop Stunnel as needed To set up Stunnel see Using Stunnel in the SEE User s Manual SEE_USR PDF or online at http www marshallsoft com stunnel htm RET
28. SMTP POP3 IMAP Email Engine Reference Library SEE_REF Version 7 3 November 21 2014 This software is provided as is There are no warranties expressed or implied Copyright C 2014 All rights reserved MarshallSoft Computing Inc Post Office Box 4543 Huntsville AL 35815 USA Email info marshallsoft com Web www marshallsoft com MARSHALLSOFT is a registered trademark of MarshallSoft Computing TABLE OF CONTENTS I I 1 1 LG 1 L NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNDNDN WM NET s MR WN zal wW0 JD RE 00 J00N4s0NnNROo FPP ds Ys GQY UY Y 0 Y 0 Y Y Y YN NDNNDNDNDN DDN DN DN WNROwo0o0o J0O0040NRp Owo00o J0dm4a ON RO oduction General Remarks SEE Arguments Documentation Set Declaration Files Language Notes Functions seeAbort seeAttach seeAttachmentParams seeByteToShort seeClose seeCommand seeConfigSSL seeDebug seeDecodeBuffer seeDecodeUTF8 seeDecodeUU seeDeleteEmail seeDriver seeEncodeBuffer seeEncodeUTF8 seeErrorText seeExtractLine seeExtractText seeForwardEmail seeGetEmailCount seeGetEmailFile seeGetEmailLines seeGetEmailSize seeGetEmailUID seeGetHeader seeGetTics seeImapConnect seeImapConnectSSL seeImapCopyMBmail seeImapCreateMB seeImapDeleteMB seeImapFlags seeImapListMB seeImapMsgNumber seeImapRenameMB seeImapSearch seeImapSelectMB seeImapSource seeIntegerParam seeIsConnected seeKillProgram seePop3Connect seePop3ConnectSSL Page P
29. T example program 21 2 15 seeEncodeUTES8 Encodes Unicode to UTF8 SYNTAX seeEncodeUTF8 UnicodeValue UTF8Buffer UnicodeValue I 16 bit unicode character UTF8Buffer P Buffer for UTF8 string REMARKS The seeEncodeUTF 8 function encodes the 16 bit Unicode value Unicode Value into a UTES string Upon return the UTF8Buffer buffer will contain the UTF8 string corresponding to the Unicode value The length of this string is returned More information on Unicode can be found at http www unicode org RETURNS e Return gt 0 Number of bytes in UTF8Buffer which will be 1 2 or 3 e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example See CODETEST C BASIC Example See CODETEST FRM ALSO REFER TO SeeDecodeUTF8 and the CODESTEST example program 22 2 16 seeErrorText Get text associated with error code SYNTAX seeErrorText Chan Errcode Buffer BufLen Chan I Channel number ErrCode 1 Error code returned by SEE function Buffer P Buffer to place error text into BufLen I Length of above Buffer REMARKS The seeErrorText function is used to get the error text associated with an error code as returned by one of the other SEE functions When an error occurs seeErrorText can be used to get the error text so that it can be displayed for the user See Section 3 SEE Error Return Code List
30. URNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example connect to POP3 server pop gmail com char Pop3Server pop gmail com char Pop3User superman gmail com char Pop3Pass sorry Code seePop3ConnectSSL O 8802 995 Pop3Server Pop3User Pop3Pass NULL BASIC Example connect to POP3 server pop gmail com Dim Pop3Server Pop3User Pop3Pass As String Pop3Server pop gmail com Pop3User supermantgmail com Pop3Pass sorry Code seePop3ConnectSSL 0 8802 995 Pop3Server Pop3 User Pop3Pass Chr 0 ALSO REFER TO seeSmtpConnectSSL and ReadSSL example program 53 2 44 seePop3Source Specified file from which to read undecoded email SYNTAX seePop3Source Chan Pop3Filename Chan I Channel number Pop3Filename P POP3 filename REMARKS The seePop3Source function is used to specify the path to a file containing an undecoded email After calling this function seeGetEmailFile can be called to decode the email as 1f it were being downloaded from a POP3 server Note that there is no POP3 connection RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example decode email file char Source c see4c apps raw_email txt Code seePop3Source 0 char Source BASIC Example decode email file Dim Source As String Source c see4c apps raw_email txt
31. age Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Ou GS OONN WBWNNNNNNNNN ND 1 e O DOOSI OAOA Nro BWWW WWW MY Ww CDODANA OB WN UT UT DB Bw Wis as ATA FWNFR OO No wWNHEOoMUSUNKE TABLE OF CONTENTS continued 44 45 46 47 48 49 50 OL 552 53 54 55 56 557 58 59 60 61 62 63 NNNNNNN D DNNDNyDNDNDNyNyNNNDNyDN seePop3Source seeQuoteBuffer seeReadQuoted seeRelease seeSendEmail seeSendHTML seeSetErrorText seeSetProxySsL seeShortToByte seeSleep seeSmtpConnect seeSmtpConnectSSL seeSmtpTarget seeStartProgram seeStatistics seeStringParam seeTestFileSet seeUnquoteBuffer seeVerifyFormat seeVerifyUser 3 SEE Error Return Code List Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page Page 54 55 56 57 58 60 62 63 65 66 67 68 69 70 71 73 75 76 77 78 79 1 Introduction The SMTP POP3 IMAP Email Engine Library SEE is a developer toolkit that provides a simple interface to quickly develop SMTP POP3 IMAP mail applications and can be used with any program capable of calling the Windows API The SMTP POP3 IMAP Email Engine SEE is a component l
32. al Visual Fortran 2 SEE Functions 2 1 seeAbort Abort seeDriver SYNTAX seeAbort Chan Chan 1 Channel number REMARKS The seeAbort function is used to abort the SEE state driver This is used when calling the SEE state driver seeDriver directly and it is necessary to abort After calling seeAbort subsequent calls to seeDriver will return 0 IDLE Thus SEE is ready for the next command This function is not required unless the state driver seeDriver is being called directly RETURNS e Return lt 0 An error has occurred See Section 3 SEE Error Return Code List C C Example Abort SEE seeAbort 0 BASIC Example Abort SEE Code seeAbort 0 ALSO REFER TO seeDriver 2 2 seeAttach Initialize SMTP POP3 IMAP Email Engine SYNTAX seeAttach NbrChans KeyCode NbrChans I Number of channels or threads KeyCode L Registration key code REMARKS The seeAttach function must be the first SEE call made Pass the maximum number of channels or threads that will be in use Use NbrChans 1 for non threaded applications The Chan parameter for subsequent calls to SEE functions must be in the range of 0 to NbrChans 1 In Win32 up to 128 threads numbered from 0 to 127 can be started each of which can be connected to a different server and run independently When SEE is registered you will receive a Registration KeyCode which matches the KeyCode within the
33. buffer REMARKS The seeShortToByte function converts the null terminated character buffer Buffer from 16 bit Unicode ASCII characters to 8 bit ASCII characters The buffer must be null terminated last character is a hex 00 This function is only necessary when working with 16 bit Unicode ASCII characters in C and Delphi 2005 RETURNS e Length of string in words EXAMPLES C C Example int Code define 16 bit ASCII string wchar t UnicodeString L MarshallSoft Convert 16 bit ASCII string to 8 bit ASCII Code seeShortToByte char UnicodeString ALSO SEE seeByteToShort 65 2 53 seeSleep Sleeps Specified Milliseconds SYNTAX seeSleep MilliSecs MilliSecs I Number of milliseconds to sleep REMARKS seeSleep is intended primarily for programming in languages that do not have a native Sleep function RETURNS e Milliseconds slept EXAMPLES C C Example sleep 1 second seeSleep 1000 BASIC Example sleep I second Code seeSleep 1000 2 54 seeSmtpComnect Connects to SMTP server SYNTAX seeSmtpConnect Chan Server From ReplyTo Chan I Channel number Server P SMTP server From P Your email address in brackets ReplyTo P Email address to reply to REMARKS The seeSmtpConnect function establishes a connection with the SMTP server as specified by the Server argument Your SMTP server name will typically be named mail XXX com where XXX is your emai
34. bytes copied to the SSL configuration file e Return lt 0 An error has occurred See Section 3 SEE Error Return Code List EXAMPLES C C Example char Option debug 7 Code seeConfigSSL SSL_CONFIG_OPTIONS Option BASIC Example Dim Option As String Option debug 7 Code seeConfigSSL SSL_CONFIG_OPTIONS Option ALSO REFER TO MailSSL example program 13 2 9 seeDebug Returns debug information SYNTAX seeDebug Chan Index Buffer BufLen Chan Channel number 1 I Command index Buffer P Buffer to place text into I Length of above Buffer REMARKS The seeDebug function returns textual debug information depending on the value of Index SEE_COPY_BUFFER Copies internal buffer SEE_GET_ATTACH_NAMES Gets list of attachment file names SEE_GET_LAST_RECIPIENT Gets last recipient acknowledged by server SEE GET LAST RESPONSE Gets last server respons SEE GET LOCAL IP Gets local IP address SEE GET REGISTRATION Gets the SEE registration string SEE GET SERVER IP Get server IP address in dotted notation SEE GET ATTACH TYPES Get list of attachment types 14 SEE_COPY_BUFFER is used to copy the internal SEE buffer created when calling seeGetEmailLines with NULL passed for Buffer Refer to seeGetEmailLines for details ALSO REFER TO SEE_WRITE_BUFFER in seeStringParam SEE_GET_ATTACH_NAMES gets the list of filenames received fr
35. d until you call seeClose Be careful Once an email has been deleted from the server it cannot be recovered The seeDeleteEmail function is used with POP3 and IMAP servers only RETURNS Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example delet mail message 1 first email message on server seeDeleteEmail 0 1 BASIC Example delet mail message 1 first email message on server Code seeDeleteEmail 0 1 ALSO REFER TO seeGetEmailUID seeGetEmailCount READER example program 19 2 13 seeDriver Executes next SEE state SYNTAX seeDriver Chan Chan 1 Channel number REMARKS The seeDriver function executes the next state in the SEE state engine The purpose of this function is to allow the programmer to get control after the driver executes each state The seeDriver function is explicitly called only after the AUTO_DRIVER_CALL flag has been disabled see function seeIntegerParam If the AUTO_DRIVER_CALL flag has not been disabled the default then seeDriver does not need to be called Refer to the Section 6 Theory of Operation in the SMTP POP3 IMAP Email User s Manual SEE_USR for more details on the operation of seeDriver RETURNS e Return 0 The driver is done e Return gt 0 The returned value is the state just executed e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C
36. e verify email address format char EmailAddr lt you yourisp com gt Code seeVerifyFormat char EmailAddr BASIC Example verify email address format Dim EmailAddr As String EmailAddr lt you yourisp com gt Code seeVerifyFormat EmailAddr ALSO REFER TO seeErrorText and seeVerifyUser VERUSR example program 77 2 63 seeVerifyUser Verify email address with SMTP server SYNTAX seeVerifyUser Chan String Chan I Channel number String P Email address to verify REMARKS The seeVerifyUser function is used to verify an individual email address with the email server which owns the email address seeVerify will connect to the specified server and request verification of the user Many SMTP servers may refuse connection of any client not directly connected to them or may refuse all verify user requests Web based email servers hotmail gmail yahoo mail etc typically will not honor any verify user requests Note that the connection must be to the SMTP server that owns the email address rather than the SMTP server normally used to send email The seeVerifyUser function is used with SMTP servers only RETURNS TRUE non zero if verified by server EXAMPLES C C Example verify user billy on connected POP3 server yourisp com char User billy Code seeVerifyUser 0 char User BASIC Example verify user billy on connected POP3 s
37. enames SEE_ATTACH_DELIMITER is the character that delimits attachment name from file name used to specify an attachment name different from the filename For example FileName txtlAttachName txt SEE_AUTHENTICATE_PROTOCOL specifies the protocol to use in performing SMTP authentication Values are AUTHENTICATE_CRAM value 1 AUTHENTICATE_LOGIN value 2 and AUTHENTICATE_PLAIN value 4 SEE AUTO CALL DRIVER controls whether seeDriver is called automatically to completion after a SEE function has been called SEE_BLOCKING_MODE allows connect attempts to block waiting for the server response SEE_CONNECT_WAIT is the maximum time allowed to complete a connection to the email server SEE_DECODE_UNNAMED will force if non zero decoding of all base64 attachments which do not have names SEE_ENABLE_APOP directs that the APOP command will be used for authenticating POP3 connections rather than USER and PASS Requires that POP3 server recognizes the APOP command SEE_ENABLE_ESMTP enables ESMTP rather than SMTP connections when calling seeSmtpConnect SEE ENABLE IMAGE allows if non zero files ending with GIF BMP JPG or TIF to be attached as image types so that they can be displayed by the recipient s email client SEE_FILE_PREFIX controls whether 1 2 etc is prefixed to the filename of each attachment If two attachments are named FILEONE ZIP and FILETWO ZIP they will be saved as 1 FILEONE ZIP and 2 FILETWO Z
38. er e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example extract line 4 from multi line buffer ListBuffer char LineBuffer 128 seeExtractLine char ListBuffer 4 char LineBuffer 128 BASIC Example extract line 4 from multi line buffer ListBuffer Dim LineBuffer As String 128 seeExtractLine ListBuffer 4 LineBuffer 128 ALSO REFER TO seeGetEmailLines and seeExtractText STATUS example program 24 2 18 seeExtractText Extract specified text from buffer SYNTAX seeExtractText Src Text Buffer BufSize Src P Text buffer to search Text P Text searching for Buffer P Buffer for line if found BufSize I Size of Buffer REMARKS The seeExtractText function is used to search the text buffer Src for text Text If the specified text is found then the entire line up to a maximum of BufSize bytes is copied to Buffer The primary purpose of seeExtractText is to extract header lines from the buffer after calling seeGetEmailLines Recall that all lines returned by seeGetEmailLines are terminated by a carriage return linefeed pair The seeExtractText does not require a connection to a SMTP or POP3 server RETURNS e Return gt 0 Number of bytes placed in Buffer e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example extract line from Buffer contai
39. er command to SMTP or POP3 server SYNTAX seeCommand Chan Text Chan 1 Channel number Text I Command REMARKS The seeCommand function sends an arbitrary text command to the SMTP POP3 or IMAP4 server after connecting The seeCommand function is designed to allow the user to send commands that are specific to a particular SMTP or POP3 server It can also be used to send SMTP POP3 or IMAP4 commands that are not implemented in the SEE library Call seeDebug with SEE_GET_LAST_RESPONSE in order to get the text of the server s response RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example send NOOP command to server char X NOOP Code seeCommand 0 X BASIC Example send NOOP command to server X NOOP Chr 0 Code seeCommand 0 X ALSO REFER TO HELLO example program 12 2 7 seeConfigSSL Add lines to SSL configuration file SYNTAX seeConfigCode ConfigCode ConfigPtr ConfigCode I Configuration code ConfigPtr P Configuration text REMARKS The seeConfigSSL function adds lines to the SSL configuration file seeConfigSSL provides the ability to customize the SSL configuration file for a specific server as required Pass SSL_CONFIG_OPTIONS as the ConfigCode parameter to specify that the contents of ConfigPtr are to be copied to the OPTIONS section of the SSL configuration file RETURNS e Return gt 0 Number of
40. erver yourisp com Dim User As String User billy Code seeVerifyUser 0 User ALSO REFER TO seeErrorText and seeDebug VERUSR example program 78 3 SEE Error Return Code List The complete list of SEE error codes follows These error messages can also be found by calling the seeErrorText function SEE CANNOT COMPLY SEE NO ERROR SEE EOF SEE IS BLOCKING SEE INVALID SOCKET SEE TIMED OUT SEE NO SOCK ADDR SEE NO HOST SEE ABORTED SEE CANNOT CREATE SOCK SEE ALREADY CONNECTED SEE BACK OVERFLOW SEE BAD ADDRESS CHAR SEE CANNOT ATTACH SEE CANNOT OPEN SEE CONNECT ERROR SEE EMPTY ADDRESS SEE FROM NULL ARG SEE MISSING AT CHAR SEE MISSING FROM SEE MISSING LEFT SEE MISSING RIGHT SEE NOT CONNECTED SEE NO RECIPIENTS SEE NO SERVER SEE NULL POINTER SEE SMTP ERROR SEE EMAIL NULL ARG SEE SOCK READ ERROR SEE SOCK WRITE ERROR SEE TOO MANY AT CHARS SEE CANNOT ALLOC SEE NOT SERVER SEE NO APOP TIMESTAMP SEE SMTP ONLY SEE POP3 ONLY SEE OBSOLETE PARAMETER SEE USER NULL ARG SEE PASS NULL ARG SEE POP3 ERROR SEE MSG NBR RANGE SEE FILENAME NULL ARG SEE EMAIL PATH NULL ARG SEE CANNOT CREATE SEE BUFFER NULL ARG SEE BUFFER SIZE ARG Cannot comply Not always an error No error End of file socket has been closed Socket is currently blocking Invalid socket Socket timed out awaiting data No socket address No host
41. he ImapFlags example program EXAMPLES C C Example Flags IMAP_FLAG_ANSWERED IMAP_FLAG FLAGGED Code seelmapFlags 0 1 IMAP_SET_FLAGS Flags BASIC Example Flags IMAP_FLAG_ANSWERED IMAP_FLAG_FLAGGED Code seeImapFlags 0 1 IMAP_SET_FLAGS Flags 39 2 33 seelmapListMB List all available mailboxes on IMAP server SYNTAX seeImapListMB Chan Buffer BufLen Chan 1 Channel 0 1 2 Buffer P Buffer into which the list of mailboxes are copied BufLen I Length of above buffer REMARKS The seelmapListMB function is used to ask for a full list of all mailboxes The exact format of the list will vary according to the server s operating system Under normal circumstances the user will already know which mailboxes have been created The seelmapListMB function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example char Buffer 3000 Code seeImapListMB 0 char Buffer 3000 BASIC Example Dim Buffer As String Buffer SPACE 3000 Code seeImapListMB 0 Buffer 3000 40 2 34 seeImapMsgNumber Gets message s filled by seelmapSearch SYNTAX seeImapMsgNumber Chan Command Chan I Channel 0 1 2 Command 1 Command see below Command Symbol Value Meaning IMAP_SEARCH_MSG_COUNT 1 Get messages found by see
42. ibrary of functions providing easy control of the SMTP Simple Mail Transport Protocol POP3 Post Office 3 and IMAP 4 Internet Message Access Protocol protocols A simple interface allows sending and receiving mail including multiple MIME base64 and quoted printable encoded attachments from within an application Knowledge of Winsock and TCP IP is not needed We have versions of the SMTP POP3 IMAP Email Engine for C C SEE4C Delphi SEE4D Visual Basic SEE4VB PowerBASIC SEE4PB Visual FoxPro SEE4FP Visual dBase SEE4DB Alaska Xbase SEE4XB and COBOL SEE4CB All versions of SEE use the same DLLs SEE32 DLL and SEE64 DLL and can be called from any program or compiler that can call the Windows API The latest version of our SMTP POP3 IMAP Email component software and complete technical documentation can be found online at http www marshallsoft com email component library htm This SMTP POP3 IMAP Email Reference Manual SEE REF contains details on each individual SEE function 1 1 General Remarks All functions return an integer code Negative values are always errors Refer to Section 3 0 below SEE Error Return Code List The file seeErrors txt contains a list of all error codes and their corresponding numeric value Non negative return codes are never errors Note that the seeErrorText function is used to get the text message associated with any error code Each function argument is marked as I
43. ill allow some email clients to play the WAV file when the attachment is clicked The seeAttachmentParams is used with SMTP servers only RETURNS e Return lt 0 An error has occurred See Section 3 SEE Error Return Code List EXAMPLES C C Example set content parameters for first attachment char ContentType Content Type audio x wav char XferEncoding Content Transfer Encoding base64 char Disposition Content Disposition attachment filename myfile wav char Description Content Description This is an audio wave file Code seeAttachmentParams ContentType XferEncoding Disposition Description BASIC Example set content parameters for first attachment Dim ContentType XferEncoding Disposition Description As String ContentType Content Type audio x wav XferEncoding Content Transfer Encoding base64 Disposition Content Disposition attachment filename myfile wav Description Content Description This is an audio wave file Code seeAttachmentParams ContentType XferEncoding Disposition Description ALSO REFER TO seeSmtpConnect seePop3Connect MParts example program 2 4 seeByteToShort Converts 8 bit character buffer to 16 bit SYNTAX seeByteToShort Buffer Buffer P character buffer REMARKS The seeByteToShort function converts the null terminated character buffer Buffer from 8 bit ASCII characters to 16 bit Unicode AS
44. iseconds since the system was booted divided by the divisor For example to get milliseconds call seeGetTicks 1 To get seconds call seeGetTicks 1000 RETURNS e Return gt 0 The number of milliseconds since the system was booted divided by the divisor e Return 0 If Divisor lt I EXAMPLES C C Example get ticks in units of 1 100 second n seeGetTicks 10 BASIC Example get ticks in units of 1 100 second n seeGetTicks 10 33 2 27 seeImapConnect Connects to IMAP server SYNTAX seeImapConnect Chan Pop3Ptr UserPtr PassPtr Chan I Channel number Pop3Ptr P IMAP server name UserPtr P Sender s email address PassPtr P Reply To header REMARKS The seeImapConnect function is used to connect to an IMAP server Note that seelmapConnect uses the same arguments as seePop3Connect The well known IMAP default port is 143 but can be changed by calling seeIntegerParam Chan SEE IMAP PORT new port to use RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example connect to POP3 server mail yourisp com char ImapHost mail yourisp com char ImapUser bill char ImapPass abc Code seeImapConnect 0 char ImapHost char ImapUser char ImapPass BASIC Example connect to Imap server mail yourisp com Dim ImapHost ImapUser ImapPass As String ImapHost mail yourisp com ImapUser
45. ithmically For this reason the programmer must write code to find any UU encoded attachments and decode one line ata time UU encoding has been obsolete since the advent of MIME encoding Nevertheless some UU encoded attachments are still being emailed and therefore this function is provided RETURNS e Return gt 0 Number of bytes copied to ClearBuf e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example decode test UU encoded string lstrcpy char CodedBuff char 36 R lt VAA amp Q3 VOT 0 7 U amp ENORX r n CodedLen lstrlen char CodedBuff ClearLen seeDecodeVU char CodedBuff char ClearBuff ClearBuff ClearLen M0 BASIC Example decode test UU encoded string CodedBuff 36 R lt VAA 03 V9T 0 7 U EN9RX Chr 13 Chr 10 CodedLen Len CodedBuff ClearLen seeDecodeUU CodedBuff ClearBuff ClearBuff Left ClearBuff ClearLen ALSO REFER TO seeDecodeBuffer 18 2 12 seeDeleteEmail Deletes email from the Server SYNTAX seeDeleteEmail Chan MsgNbr Chan I Channel number MsgNbr I Message number REMARKS The seeDeleteEmail function deletes the email numbered MsgNbr from the server The first message is always number 1 Call seeGetEmailCount first to get the number of email messages on the server Email is not renumbered or physically delete
46. ize of DstBuffer REMARKS The seeUnquoteBuffer function unquotes quoted strings in email messages Although unquoting is done automatically by SEE there are situations where an unquote function may be needed The size of the destination buffer DstBuffer should be at least as big as the size of the source string SrcBuffer RETURNS TRUE non zero if verified by server EXAMPLES C C Example char Quoted Ce messag st E9crit en fran E7ais char Buffer 256 Code seeUnQuoteBuffer Quoted char Buffer 255 BASIC Example Dim Quoted As String Dim Buffer As String Quoted Ce messag st E9crit en fran E7ais Buffer SPACE 256 Code seeUnQuoteBuffer Quoted Buffer 255 ALSO REFER TO seeQuoteBuffer and the iso8859 example program 76 2 62 seeVerifyFormat Check email address format SYNTAX seeVerifyFormat String String P Email address to check REMARKS The see VerifyFormat function is used to test an individual email address for proper formatting If this function returns 0 or greater then the email address is properly formatted But if this function returns a negative value then the email address is either badly formatted or it uses characters such as that are not normally used as part of an email address Note that left and right brackets lt and gt must surround the email address RETURNS TRUE non zero if verified EXAMPLES C C Exampl
47. l address such as name OXXX com Your SMTP server name can also be found in the setup information for your normal email client such as Eudora or Microsoft Outlook The SMTP server name can also be specified in dotted decimal notation For example 10 23 231 1 The From string is required and must be enclosed in lt gt brackets such as lt you yourisp com gt The ReplyTo string is optional and is used for the Reply To header line If used the email address must be enclosed in lt gt brackets SEE can not be connected to both the SMTP server and the POP3 server at the same time Call seeClose to terminate the connection before connecting again RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example connect to SMIP server char Server smtp yourisp com char From lt you yourisp com gt char Reply Code seeSmtpConnect 0 char Server char From char Reply BASIC Example connect to SMTP server Server smtp yourisp com From lt you yourisp com gt Reply Chr 0 Code seeSmtpConnect 0 Server From Reply ALSO REFER TO seeClose MAILER example program 67 2 55 seeSmtpConnectSSL Connects to SMTP Server with SSL SYNTAX seeSmtpConnectSSL Chan ProxyPort SmtpPort SmtpServer SmtpUser SmtpPass SmtpFrom SmtpReply ProxylP Chan I Channel number ProxyPort I Port to con
48. ll outgoing email SEE SET HELO STRING Sets custom HELO EHLO string SEE IMAP LIST ARGUMENT is used to specify the IMAP argument used to request a list The default is without the brackets A common alternative is without the brackets SEE_ADD_HEADER is used to add a user specified header line SEE_LOG_FILE specifies the name of the LOG file to create The log file is used to debug a SMTP or POP3 session Be advised that log files can be quite large Don t use them unless necessary SEE SET CONTENT TYPE is used to specify the content type string to use when enabling quoting with seeIntegerParam Chan SEE_QUOTED_PRINTABLE QUOTED_USER SEE_SET_FROM is used to specify the From header line after connecting to the SMTP server SEE_SET_HEADER is used to set one or more header lines Each header line except the last should end with a carriage return line feed pair 73 SEE_SET_REPLY to change the Reply To header after connecting to the server just before sending an email SEE_SET_SECRET is used to specify the user s password for ESMTP authentication SEE_SET_TRANSFER_ENCODING is used to specify the content transfer encoding to use when enabling quoting with SeeIntegerParam Chan SEE_QUOTED_PRINTABLE QUOTED_USER SEE_SET_USER is used to specify the user name for ESMTP authentication SEE_WRITE_BUFFER is used to write the internal buffer created by seeGetEmailLines to disk See the G
49. lmapSearch IMAP SEARCH FIRST MSG 2 Get first message of set found IMAP SEARCH NEXT MSG 3 Get next message of set found REMARKS The seelmapMsgNumber function called immediately after seelmapSearch and is used to return 1 the number of messages found by seelmapSearch 2 the first message found by seeImapSearch 3 the next message found by seelmapSearch call iteratively See the ImapSearch example program The seelmapMsgNumber function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List e Return gt 0 messages found if passed IMAP_SEARCH_MSG_COUNT e First message number found if passed IMAP_SEARCH_FIRST_MSG e Next message number found if passed IMAP_SEARCH_NEXT_MSG EXAMPLES C C Example NbrMsg seeImapMsgNumber 0 IMAP_SEARCH_MSG_COUNT BASIC Example NbrMsg seeImapMsgNumber 0 IMAP_SEARCH_MSG_COUNT ALSO REFER TO ImapSearch example program 41 2 35 seelmapRenameMB Rename IMAP mailbox SYNTAX seeImapRenameMB Chan FromName ToName Chan I Channel 0 1 2 FromName P Existing name of mailbox ToName P New name of mailbox REMARKS The seelmapRenameMB function is used to rename a new mailbox MB The seelmapRenameMB function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example char S
50. me char EmailDir char AttachDir BASIC Example Dim FileName EmailDir AttachDir As String FileName Email4 txt EmailDir SEE4C APPS AttachDir SEE4C APPS Code seeGetEmailFile 0 4 FileName EmailDir AttachDir ALSO REFER TO seeGetEmailLines and seePop3Source READER example program 28 2 22 seeGetEmailLines Read lines from email message SYNTAX seeGetEmailLines Chan MsgNbr Lines Buffer Size Chan I Channel number MsgNbr I Messag a Lines I Number of body lines Buffer P Pointer to static Buffer Size I Size of buffer REMARKS The seeGetEmailLines function reads all header lines plus the number of body lines specified by the Lines argument into Buffer up to a maximum of Size bytes The primary purpose of this function is to read the header lines without having to read the entire message If you have disabled the driver AUTO_CALL capability the size must be found by calling seeStatistics Chan SEE_GET_BUFFER_COUNT after calling seeDriver until it returns 0 If a 0 is passed as the 4th argument Buffer SEE will use an internal buffer the contents of which can be accessed by subsequently calling seeDebug Chan SEE_COPY_BUFFER or calling seeStringParam Chan SEE_WRITE_BUFFER This technique is ONLY necessary in direct mode calling seeDriver directly from languages such as Visual Basic dBase 2000
51. me which contains the message to send Attach may contain one or more attachments separated by semi colons with no embedded spaces For example filel zip file2 doc file3 bmp The default delimiter used to separate email addresses and path names was changed from a comma to a semi colon in Version 3 6 of SEE The semi colon delimiter can be changed to any character with seeIntegerParam Chan SEE ATTACH DELIMITER new character If the function seeIntegerParam Chan SEE ENABLE IMAGE 1 has been called previously attachment files ending with GIF BMP or TIF are attached as image types rather than regular images This allows some email clients to display the images The seeSendEmail function is used with SMTP servers only 58 RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example email file Message txt to info yourisp com char To lt info yourisp com gt char CC char BCCI char Subject Test char Message Message txt char Attach Code seeSendEmail 0 char To char CC char BCC char Subject char Message char Attach BASIC Example email file Message txt to info yourisp com Dim To CC BCC Subject Message Attach To lt info yourisp com gt CC Chr 0 BCC Chr 0 Subject Test Message Message txt
52. mmand line for external program REMARKS The seeStartProgram function starts the specified external program The command line contains the pathname of the executable plus any additional command line arguments if any seeStartProgram can start any Win32 program The primary purpose of seeStartProgram is to start external programs such as proxy servers C C Example char Stunnel c stunnel stunnel exe c stunnel SMTPgmail txt int hProcess Starting STUNNEL hProcess seeStartProgram char Stunnel BASIC Example Dim Stunnel As String Dim hProcess As Integer Stunnel c stunnel stunnel exe c stunnel SMTPgmail txt Starting STUNNEL hProcess seeStartProgram Stunnel RETURNS e Return 1 Cannot start process e Return gt 0 Process ID ALSO REFER TO seeKillProgram 70 2 58 seeStatistics Returns runtime statistics SYNTAX seeStatistics Chan Index Chan I Channel number Index I Specifies which statistic REMARKS The seeStatistics function is used to return runtime statistics in the SEE DLL The values of Index are defined in the SEE declaration file see Section 1 3 Declaration Files as follows ATTACH BYTES READ Gets attachment bytes read ATTACH BYTES SENT Gets attachment bytes sent _ATTACH_COUNT Gets attachments received _GET_BUFFER_COU Gets bytes i
53. mple int hProcess kill STUNNEL Code seeKillProgram hProcess 0 BASIC Example Dim hProcess As Long kill STUNNEL Code seeKillProgram hProcess 0 ALSO REFER TO seeStartProgram 51 2 42 seePop3Connect Connects to POP3 Server SYNTAX seePop3Connect Chan Pop3Ptr UserPtr PassPtr Chan I Channel number Pop3Ptr P POP3 server name UserPtr P POP3 user name PassPtr P POP3 password REMARKS The seePop3Connect function establishes a connection with the POP3 server as specified by the Server argument The POP3 server name will typically be named mail XXX com where XXX is your email address such as name OXXX com Your POP3 server name can also be found in the setup information for your normal email client such as Eudora or Microsoft Outlook The POP3 server name can also be specified in dotted decimal notation For example 10 23 231 1 SEE can not be connected to both the SMTP server and the POP3 server at the same time Call seeClose to terminate the connection before connecting again RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example connect to POP3 server mail yourisp com char Pop3Host mail yourisp com char Pop3User bill char Pop3Pass abc Code seePop3Connect 0 char Pop3Host char Pop3User char Pop3Pass BASIC Example connect to POP3 server mail yourisp com Dim
54. n buffer for seeGetEmaillines GET BUILD Gets version build number GET CONNECT STATUS Returns positive number if connected GET COUNTER Gets times driver called ET LAST RECIPIENT Gets last recipient ack d by server MESSAGE BYTE N MESSAGE BYTES S READ Gets message bytes read SENT Gets message bytes sent ANNANNNANNNNNANNANNNWN AAAAAAAAAAAMAAAAAAA xi _MSG_COUNT Gets emails waiting Al _MSG_SIZE Gets size of email pl _RESPONSE Gets last SMTP response code __GET_SOCK_ERROR Gets last socket error _GET_SOCKET Gets socket number OTAL_BYTES_READ Gets total bytes read OTAL_BYTES_SENT Gets total bytes sent VERSION Gets the SEE version number The number of message bytes sent will usually be larger than your message size because of SMTP protocol overhead The number of attachment bytes sent will be at least one third larger than the actual attachment since every three 3 bytes are encoded as four 4 7 bit ASCII bytes before being transmitted The purpose of BYTES_READ and BYTES_SENT is to provide the ability to track the transmission progress of large messages and attachments SEE_GET_ATTACH_BYTES_READ gets the number of attachment bytes read SEE_GET_ATTACH_BYTES_SENT gets the number of attachment bytes sent SEE_GET_ATTACH_COUNT gets the numbe
55. n the server e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example get the size of email message 2 MsgSize seeGetEmailSize 0 2 BASIC Example get the size of email message 2 MsgSize seeGetEmailSize 0 2 ALSO REFER TO seeGetEmailCount STATUS and READER example programs 30 2 24 seeGetEmailUID Get user ID from the server SYNTAX seeGetEmailUID Chan MsgNbr Buffer Size Chan I Channel number MsgNbr I Message 1 for all number Buffer P Pointer to Buffer Size I Size of buffer REMARKS The seeGetEmailUID function is used to ask the POP3 server for the unique user ID string for a particular email message or for all email messages on the server The UID string is always unique for a particular email message regardless of the email message number or when it was received The purpose of the UID is to allow the client to determine if a particular email has been seen by it previously The UID is useful is situations in which mail is left on the server and is accessed by more than one email client program Most POP3 servers can provide such a unique ID string A few POP3 servers do not provide ID strings The seeGetEmailUID function is used with POP3 and IMAP servers only RETURNS e Return gt 0 The number of bytes in moved into Buffer e Return lt 0 An error has occurred See section 3 SEE Error Return Code List
56. name The DLL has been corrupted Cannot create socket Already connected to server Response buffer has overflowed Bad character in email address Cannot access DLL Cannot open file for read Error attempting to connect EMPTY email address Required From argument is NULL Missing character in email address Missing From email address Missing lt delimiter in email address Missing gt terminating email address Not connected to server Must have at least one recipient Cannot find SMTP POP3 IMAP server Unexpected NULL pointer SMTP returned error SMTP POP3 IMAP server not specified Socket read error Socket write error Too many symbols in email address Cannot allocate memory Illegal chars in server name POP3 server did not provide a timestamp Must be connected to SMTP server Must be connected to POP3 server Parameter is obsolete Expected USER name not specified Required POP3 password argument missing Error returned by POP3 server Message number out of range Required filename is missing Required file path is missing Cannot create file Required buffer is missing Buffer size argument is not positive 79 SEE Error Return Code List continued 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 98 99 SEE_ATTACH_PATH_NULL_ARG Attachment argument is missing SEE_NOT_ATTACHED SEE_ALREADY_ATTA
57. nect to proxy on SmtpPort I SMTP port normally 465 or 587 SmtpServer P SMTP server name SmtpUser P User name SmtpPass P Password SmtpFrom P Sender s email address SmtpReply P Reply To email address ProxyIP P Host name or IP address of proxy server REMARKS The seeSmtpConnectSSL function is used to connect to an SMTP server with SSL seeSetProxySSL must be called before calling seeSmtpConnectSSL ProxyPort can be an unused port SmtpPort for SSL will normally be 465 or 587 SmtpServer is the name or IP address of the SMTP server SmtpUser is the user name and SmtpPass is the password The SmtpFrom string is required and must be enclosed in lt gt brackets such as lt you yourisp com gt The SmtpReply string is optional and is used for the Reply To header line If used the email address must be enclosed in lt gt brackets ProxyIP is the host name or IP address of the proxy server Pass NULL or an empty string to specify this computer 127 0 0 1 Stunnel must first be installed seeSmtpConnectSSL will automatically start and stop Stunnel as needed To set up Stunnel see Using Stunnel in the SEE User s Manual SEE_USR PDF or online at http www marshallsoft com stunnel htm RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example connect to SMTP server smtp gmail com via port 8801 char Server smtp gmail com char
58. ning Reply To char Buffer 255 n seeExtractText Buffer char Reply To Buffer 255 BASIC Example extract line from Buffer containing Reply To ExString Reply To Dim Buffer As String 255 n seeExtractText Buffer ExString Buffer 255 ALSO REFER TO seeGetEmailLines seeExtractLine STATUS and FROM example programs 25 2 19 seeForwardEmail Forward email SYNTAX seeForward Chan To CC BCC Subj Msg Forward Chan I Channel number To P Recipient separated by semi colons CC P CC list separated by semi colons BCC P BCC list separated by semi colons Subj P Subject text Msg P Message or message filenam Forward P Filename of undecoded email to forward REMARKS The seeForward function is used to forward an email to a new recipient The filename of the undecoded email to be forwarded must be attached as the last argument and is encoded as a message rfc822 MIME part For an explanation of how to download an undecoded copy of an email refer to the REMARKS section provided for the seeGetEmailFile function The seeForwardEmail function is used with SMTP servers only RETURNS e Return gt 0 The number of bytes read e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example forward undecoded email file Email2Forward to lt info yourisp com gt Code seeForwardEmail
59. om downloading email from a POP3 server Call only after all email has been read SEE_GET_LAST_RECIPIENT gets the last recipient acknowledged by the POP3 server This is only useful when running in direct mode calls seeDriver when a list of email addresses is being used in one call to seeSendEmail SEE_GET_LAST_RESPONSE gets the text of the last server response SEE_GET_LOCAL_IP gets the local IP address in dotted decimal notation Use this only after connecting to an SMTP or POP3 server SEE_GET_REGISTRATION gets the user s SEE registration string SEE_GET_SERVER_IP gets the server IP address in dotted decimal notation Use this only after connecting to an SMTP or POP3 server SEE_GET_ATTACH_TYPES gets a list of attachment types separated by semi colons Use only after completely downloading the email message RETURNS e Return gt 0 Number of bytes copies to Buffer e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example Get text of last server respons char Buffer 128 Code seeDebug 0 SEE_GET_LAST_RESPONSE char Buffer BASIC Example Get text of last server respons Dim Buffer As String 128 Code seeDebug 0 SEE_GET_LAST_RESPONSE Buffer 128 ALSO REFER TO seeStatistics SEEVER and GETRAW example programs 128 15 2 9 seeDecodeBuffer Decodes buffer using base64
60. on 1 4 Declaration Files The exact syntax for calling SMTP POP3 IMAP Email component SEE functions is specific to the host language C C Delphi VB etc and is defined for each language in the SEE declaration files Each SEE product comes with the appropriate declaration file for the supported language For example SEE4C C C NET C SEE H SEE4D Codegear Borland Delphi SEE32 PAS and SEE64 PAS SEE4VB Visual Basic SEE32 BAS and SEE64 BAS VB NE SEE32 VB and SEE64 VB VBA EXCEL ACCESS etc SEE32 BAS and SEE64 BAS SEE4PB PowerBASIC SEE32 PBI SEE4FP Visual FoxPro SEE32 FOX SEE4DB Visual dBase SEE32 CC SEE4XB Xbase SEE32 CH SEE4CB Fujitsu COBOL SEE32 CBI If you are programming in a language that is capable of calling Windows API functions directly then your application can also call SEE functions Let us know if you need a declaration file such a language Most SEE functions are used in one or more of the example programs 1 5 Language Notes All language versions of the SMTP POP3 IMAP Email component library include the example program SEEVER Refer to this program and the declaration file as defined in Section 1 3 above to see how SEE functions are called The SEEVER program is also the first program that should be compiled and run The
61. ot written Also refer to SEE_SET_CONTENT_TYPE_PREFIX 48 RETURNS e Return gt 0 Integer parameter requested e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example enable Extended SMTP needed for SMTP authentication Code seeIntegerParam 0 SEE_ENABLE_ESMTP 1 BASIC Example enable Extended SMTP needed for SMTP authentication Code seeIntegerParam 0 SEE_ENABLE_ESMTP 1 49 2 40 seeIsConnected Determine if still connected to server SYNTAX seeIsConnected Chan Chan I Channel number REMARKS The seelsConnected function tests to see if there is a live connection to the email server RETURNS e Return 0 No connectivity to server EXAMPLES C C Example if seeIsConnected 0 printf Connection is live else printf Connection has been dropped BASIC Example If seeIsConnected 0 lt gt 0 Then PRINT Connection is live Else PRINT Connection has been dropped End If 50 2 41 seeKillProgram Terminates External Program SYNTAX seeKillProgran ProcessID ExitCode ProcessID I Process ID returned from seeStartProgram ExitCode P Exit code REMARKS The seeKillProgram function kills terminates the external program process that was started by seeStartProgram The ProcessID is the process returned by seeStartProgram RETURNS e Return lt 0 Cannot kill program EXAMPLES C C Exa
62. ourceBox 128 char TargetBox 128 strcpy char SourceBox SavedBox strcpy char TargetBox ArchiveBox Code seeImapRenameMB 0 SourceBox TargetBox BASIC Example Dim SourceBox As String Dim TargetBox As String SourceBox SavedBox TargetBox ArchiveBox Code seeImapRenameMB 0 SourceBox TargetBox 42 2 36 seelmapSearch Search for IMAP messages with specified flags SYNTAX seeImapSearch Chan SearchArgs Buffer BufLen Chan I Channel 0 ly 2 7 aa SearchArgs P Search string Buffer P Result buffer where message numbers are copied BufLen I Size of result buffer REMARKS The seeImapSearch function is used to search for messages with specified strings Example search strings as passed to seelmapSearch SEEN SEEN NOT ANSWERED FLAGGED SINCE 1 Feb 2008 NOT FROM Smith LARGER 10000 NOT SEEN Refer to ImapSearch txt RFC 1730 or http www marshallsoft com ImapSearch htm for a complete list After calling seelmapSearch the function seelmapMsgNumber must be called in order to get the message numbers that seelmapSearch found that match the search criteria The seeImapSearch function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example strcpy char SearchArgs char LARGER 10000 NOT SEEN Code seeImapSearch 0 SearchArgs char Buffer 128
63. r of attachments received SEE_GET_BUFFER_COUNT gets the bytes in the buffer after calling seeGetEmailLines SEE_GET_BUILD gets the version build number 71 REMARKS continued SEE_GET_CONNECT_STATUS returns a positive number if currently connected SEE_GET_COUNTER gets the number of times that the driver has been called SEE_GET_LAST_RECIPIENT gets last recipient 1 2 acknowledged by server SEE_GET_MESSAGE_BYTES_READ gets the number of message bytes read SEE_GET_MESSAGE_BYTES_SENT gets the number of message bytes sent SEE_GET_MSG_COUNT gets the number of emails waiting on the server SEE_GET_MSG_SIZE gets the size of an email message SEE_GET_RESPONSE gets the last server response code SEE_GET_SOCK_ERROR gets the last socket error SEE_GET_SOCKET gets the socket number SEE_GE OTAL_BYTES_READ gets the total number of bytes read SEE_GE OTAL_BYTES_SENT gets the total number of bytes sent SEE_GET_VERSION gets the SEE version number see SEEVER example RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example get SEE version Code seeStatistics 0 SEE_GET_VERSION BASIC Example get SEE version Code seeStatistics 0 SEE_GET_VERSION ALSO REFER TO seeDebug seeIntegerParam and seeStringParam READER MAI
64. rgument is the path to the directory containing the proxy server ProxyCert is the X509 certificate in PEM format to use Use the included certificate STUNNEL PEM if you do not have your own PEM certificate ProxyExe is the name of the proxy executable STUNNEL EXE in this version of SEE RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List 63 EXAMPLES C C Example char ProxyDir c SEE4C SSI char ProxyExe stunnel exe char ProxyCert stunnel pen Code seeSetProxySSL 0 STUNNEL_TASKBAR_ICON ProxyDir ProxyCert ProxyExe BASIC Example ProxyDir c SEE4VB SSL ProxyExe stunnel exe 1 Code seeSetProxySSL 0 T STUNNEL_TASKBAR_ICON i ProxyDir ProxyCert 1 ProxyExe ALSO SEE seeImapConnectSSL seePop3ConnectSSL and NW proxy server directory proxy server executabl proxy certificate PEM format proxy code always 0 display Stunnel icon on task bar directory containing proxy server proxy certificate proxy program executable proxy server directory proxy server executabl proxy code always 0 display Stunnel icon on task bar directory containing proxy server proxy certificate proxy program executable seeSmtpConnectSSL 64 2 52 seeShortToByte Converts 16 bit ASCII character buffer to 8 bit SYNTAX seeShortToByte Buffer Buffer P character
65. rorCode ErrorText Chan I Channel number ErrorCode 1 Error code ErrorText P Error text REMARKS The seeSetErrorText function specifies the text to be used for a particular error code The primary reason for this function is to support error messages in a language other than English RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List C C Example seeSetErrorText SEE_NO_ERROR char pas d erreur BASIC Example Dim Text As String Text pas d erreur Code seeSetErrorText SEE NO ERROR Text 62 2 51 seeSetProxySSL Specifies Proxy Server Parameters SYNTAX seeSetProxyAutoSSL ProxyCode ProxyFlags ProxyDir ProxyCert ProxyExe ProxyCode proxy code not used ProxyFlags proxy server flags ProxyCert proxy certificate I 1 ProxyDir P proxy directory on this machine P ProxyExe P proxy executable STUNNEL EXE REMARKS The seeSetProxySSL program sets parameters for the proxy server Stunnel exe and must be called before calling seelmapConnectSSL seePop3ConnectSSL or seeSmtpConnectSSL Pass STUNNEL_TASKBAR_ICON value 1 for ProxyFlags if you want an icon for the proxy server displayed on the task bar Pass STUNNEL_DISABLE_LOGGING value 2 if you do not want a Stunnel log file created at runtime For both pass the sum STUNNEL_TASKBAR_ICON STUNNEL_DISABLE_LOGGING value 3 The ProxyDir a
66. sk Chan Ty Channel 04 le 27 235 MsgNbr I Message Number 1 2 3 Command I Command see below FlagsMask I Flag mask May be combined see below Command Symbol Value Meaning IMAP_GET_FLAGS 1 Get message flags IMAP_SET_FLAGS 2 Set message flags IMAP_DEL_FLAGS 3 Delete message flags FlagsMask Symbol Value Meaning IMAP_FLAG_SEE 1 Message has been read IMAP_FLAG_ANSWERED 2 Message has been answered IMAP_FLAG FLAGGED 4 Message is flagged for special attention IMAP_FLAG DELETED 8 Message is deleted for removal IMAP_FLAG_DRAFT 16 Message has been marked as a draft IMAP_FLAG_RECENT 32 Message has arrived since the previous time this mailbox was selected AP_FLAG_SEEN refers to Seen flag AP_FLAG_ANSWERED refers to Answered flag AP_FLAG_FLAGGED refers to Flagged flag AP_FLAG_DELETED refers to Deleted flag AP_FLAG_DRAFT refers to Draft flag AP FLAG RECENT refers to Recent flag H HHHHH Note Recent may be fetched but not stored REMARKS The seelmapFlags function is used to get set or delete message flags The seelmapFlags function is used with IMAP servers only RETURNS e Return lt 0 An error has occurred See section 3 SEE Error Return Code List e Return gt 0 IMAP flags that are set Refer to t
67. teBuffer and ISO8859 example program 55 2 46 seeReadQuoted Quotes File Contents SYNTAX seeReadQuoted PathName Buffer Buflen Width PathName P Pathname of file to be read Buffer P Buffer into which data is written BufLen I Size of above buffer Width I Width of quoted lines REMARKS The seeRead Quoted function reads the file specified by PathName and creates a quoted text string in Buffer The resulting quoted string will consists of multiple quoted lines of the length specified by Width The value of Width must be less than 254 Use 0 to specify that the default width 73 chars be used The primary use for the seeReadQuoted function is in the construction of non standard email messages that must be quoted such as EDIFACT Electronic Data Interchange for Administration Commerce and Transport email RETURNS e Return gt 0 The number of characters copied to Buffer e Return lt 0 An error has occurred See section 3 SEE Error Return Code List EXAMPLES C C Example read file write quoted to Buffer char FileName EDIFACT txt char Buffer 128 Code seeReadQuoted char FileName char Buffer 128 0 BASIC Example read file amp write quoted to Buffer Dim FileName As String Dim Buffer As String FileName EDIFACT txt Buffer Space 128 Code seeReadQuoted FileName Buffer 128 0 ALSO REFER TO seeEncodeBuffer 56 2
68. the server s response SEE_PATH_DELIMITER is the character that delimits multiple file paths SEE_POP3_PORT changes the POP3 port SEE_QUOTED_PRINTABLE controls whether messages are or are not encoded as quoted printable The 3rd parameter should be one of QUOTED_HTML QUOTED_ISO_8859_1 QUOTED_ISO_8859_2 QUOTED_ISO_8859_3 QUOTED_ISO_8859_4 QUOTED_ISO_8859_7 QUOTED_ISO_8859_8 QUOTED_OFF QUOTED_PLAIN QUOTED_RICH QUOTED_USER QUOTED_UTF8 QUOTED_WIN_1250 QUOTED_WIN_1252 QUOTED_WIN_1255 SEE RAW MODE disables all decoding of email when downloaded by seeGetEmailFile SEE_REPLACE_UNDERSCORES directs SEE to replace underscore with spaces if ParamValue TRUE or not if ParamValue FALSE in incoming email attachment filenames The default is TRUE as per RFC 2047 SEE_REPLACE_WITH_COMMAS causes the replacement of address delimiters in TO CC and BCC headers with commas SEE_SET_RAWFILE_PREFIX causes an undecoded copy of an email downloaded by seeGetEmailFile to be saved with the same name as the decoded copy except prefixed by the specified prefix character SEE_SET_CONNECT_ATTEMPTS sets the number of time SEE will attempt to connect to a server Valid values are 1 to 12 SEE_SLEEP_TIME is the time SEE sleeps when waiting on a Winsock SEE_SMTP_PORT changes the SMTP port SEE_WRITE_CONTENT_TYPE causes if ParamValue not 0 the Content Type header to be written to the output email file POP3 connections Normally this header is n
69. tring segment into a 16 bit Unicode value Upon return the first two bytes of UnicodeBuffer will contain the two bytes that make up the 16 bit Unicode value in low byte high byte order More information on Unicode can be found at http www unicode org RETURNS e Return gt 0 Number of bytes in UTF8Buffer consumed which will be 1 2 or 3 e Return 0 An error was found in the UTF8 string segment e Return lt 0 An error has occurred see section 3 SEE Error Return Code List EXAMPLES C C Example See CODETEST C BASIC Example See CODETEST FRM ALSO REFER TO seeDecodeBuffer CODETEST example program 17 2 11 seeDecode UU Decode UU encoded line SYNTAX seeDecodeUU CodedBuf ClearBuf CodedBuf P Buffer containing UU encoded text ClearBuf P Buffer into which to copy decoded text REMARKS The seeDecodeUU function is used to decode a UU encoded line passed in CodedBuf The line must be terminated with a carriage return CR character or by a NULL character For example the following UU encoded text contains the single line MarshallSoft Computing begin 666 test txt 836 R lt VAA 03 VIT 0 7 U amp EN9RX end The leading byte 8 corresponds to the length of the line 24 characters and is not passed to seeDecodeUU Refer to the example below Unlike MIME encoded attachments UU encoded attachments cannot always be located algor
70. ttach may contain one or more attachments separated by semicolons with no embedded spaces For example filel zip file2 doc file3 bmp The semi colon delimiter used above can be changed to a new character with seeIntegerParam Chan SEE_PATH_DELIMITER new character The seeSendHTML function is used with SMTP servers only 60 RETURNS e Return lt 0 An C C Example error has occurred See section 3 SEE Error Return Code List email file html htm to lt info yourisp com gt char To lt info yourisp com gt char CC us char BCC char Subject HTML Test char File html htm char Images imagel gif image2 gif char AltText AltText txt char Attach Code seeSendHTML 0 char To char CC char BCC BASIC Example char Subject char File char Images char AltText char Attach email file html htm to lt info yourisp com gt Dim To CC BCC Subject Message Images AltText Attach To lt info yourisp com gt CC Chr 0 BCC Chr Subject 0 HTML Test File html htm Images AltText Attach Chr 0 imagel gif image2 gif RAltText txt Code seeSendHTML 0 To CC BCC Subject File Attach ALSO REFER TO SENDHTML C C or HTML example program 61 2 50 seeSetErrorText Specifies Text of Error Messages SYNTAX seeSetErrorText Chan Er
Download Pdf Manuals
Related Search
Related Contents
Samsung dvdDVD-V8500 User's Manual Renesas R0E530650CFJ30 User's Manual User Manual 取扱説明書 ー 設置場所が濡れている〟 ー お湯の出が悪い。 ・ お湯が早くなくなる alarmed speed dome series tdn ip - ATL MODEL GT15-QBUS/GT15-QBUS2/GT15-ABUS/GT15 MDA / LDA / TDA Série Bejeweled - BMI Gaming IPRL-09-01 Instrucción sobre control de equipos de trabajo Copyright © All rights reserved.
Failed to retrieve file