Back to index

php5  5.3.10
sendmail.h
Go to the documentation of this file.
00001 #if !defined(sendmail_h)           /* Sentry, use file only if it's not already included. */
00002 #define sendmail_h
00003 #ifndef NETWARE
00004 #include <windows.h>
00005 #endif
00006 
00007 #define HOST_NAME_LEN       256
00008 #define MAX_APPNAME_LENGHT 100
00009 #define MAIL_BUFFER_SIZE           (1024*4)      /* 4k buffer */
00010 /* Return values */
00011 #define MIN_ERROR_INDEX                                 0 /* Always 0 like SUCCESS */
00012 #define SUCCESS                                                0
00013 #define FAILED_TO_PARSE_ARGUMENTS         1
00014 #define FAILED_TO_OPEN_MAILFILE                  2
00015 #define FAILED_TO_START_SOCKETS                  3
00016 #define FAILED_TO_RESOLVE_HOST                   4
00017 #define FAILED_TO_OBTAIN_SOCKET_HANDLE    5
00018 #define FAILED_TO_CONNECT                        6
00019 #define FAILED_TO_SEND                                  7
00020 #define FAILED_TO_RECEIVE                        8
00021 #define SMTP_SERVER_ERROR                        9
00022 #define FAILED_TO_GET_HOSTNAME                   10
00023 #define OUT_OF_MEMORY                                   11
00024 #define UNKNOWN_ERROR                                   12
00025 #define BAD_MSG_CONTENTS                         13
00026 #define BAD_MSG_SUBJECT                                 14
00027 #define BAD_MSG_DESTINATION                      15
00028 #define BAD_MSG_RPATH                                   16
00029 #define BAD_MAIL_HOST                                   17
00030 #define BAD_MSG_FILE                             18
00031 #define W32_SM_SENDMAIL_FROM_NOT_SET      19
00032 #define W32_SM_SENDMAIL_FROM_MALFORMED    20
00033 #define W32_SM_PCRE_ERROR                        21
00034 #define MAX_ERROR_INDEX                                 22 /* Always last error message + 1 */
00035 
00036 
00037 PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message,
00038                        char *RPath, char *Subject, char *mailTo, char *data,
00039                        char *mailCc, char *mailBcc, char *mailRPath TSRMLS_DC);
00040 PHPAPI void TSMClose(void);
00041 static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, 
00042                       char *headers, char *headers_lc, char **error_message TSRMLS_DC);
00043 PHPAPI char *GetSMErrorText(int index);
00044 
00045 static int MailConnect();
00046 static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC);
00047 static int Post(LPCSTR msg);
00048 static int Ack(char **server_response);
00049 static unsigned long GetAddr(LPSTR szHost);
00050 static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString);
00051 #endif                                           /* sendmail_h */