diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-03-14 05:42:27 +0000 |
---|---|---|
committer | <> | 2013-04-03 16:25:08 +0000 |
commit | c4dd7a1a684490673e25aaf4fabec5df138854c4 (patch) | |
tree | 4d57c44caae4480efff02b90b9be86f44bf25409 /win32/sendmail.h | |
download | php2-master.tar.gz |
Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2.HEADphp-5.4.13master
Diffstat (limited to 'win32/sendmail.h')
-rw-r--r-- | win32/sendmail.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/win32/sendmail.h b/win32/sendmail.h new file mode 100644 index 0000000..0a7698e --- /dev/null +++ b/win32/sendmail.h @@ -0,0 +1,51 @@ +#if !defined(sendmail_h) /* Sentry, use file only if it's not already included. */ +#define sendmail_h +#ifndef NETWARE +#include <windows.h> +#endif + +#define HOST_NAME_LEN 256 +#define MAX_APPNAME_LENGHT 100 +#define MAIL_BUFFER_SIZE (1024*4) /* 4k buffer */ +/* Return values */ +#define MIN_ERROR_INDEX 0 /* Always 0 like SUCCESS */ +#define SUCCESS 0 +#define FAILED_TO_PARSE_ARGUMENTS 1 +#define FAILED_TO_OPEN_MAILFILE 2 +#define FAILED_TO_START_SOCKETS 3 +#define FAILED_TO_RESOLVE_HOST 4 +#define FAILED_TO_OBTAIN_SOCKET_HANDLE 5 +#define FAILED_TO_CONNECT 6 +#define FAILED_TO_SEND 7 +#define FAILED_TO_RECEIVE 8 +#define SMTP_SERVER_ERROR 9 +#define FAILED_TO_GET_HOSTNAME 10 +#define OUT_OF_MEMORY 11 +#define UNKNOWN_ERROR 12 +#define BAD_MSG_CONTENTS 13 +#define BAD_MSG_SUBJECT 14 +#define BAD_MSG_DESTINATION 15 +#define BAD_MSG_RPATH 16 +#define BAD_MAIL_HOST 17 +#define BAD_MSG_FILE 18 +#define W32_SM_SENDMAIL_FROM_NOT_SET 19 +#define W32_SM_SENDMAIL_FROM_MALFORMED 20 +#define W32_SM_PCRE_ERROR 21 +#define MAX_ERROR_INDEX 22 /* Always last error message + 1 */ + + +PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message, + char *RPath, char *Subject, char *mailTo, char *data, + char *mailCc, char *mailBcc, char *mailRPath TSRMLS_DC); +PHPAPI void TSMClose(void); +static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data, + char *headers, char *headers_lc, char **error_message TSRMLS_DC); +PHPAPI char *GetSMErrorText(int index); + +static int MailConnect(); +static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders TSRMLS_DC); +static int Post(LPCSTR msg); +static int Ack(char **server_response); +static unsigned long GetAddr(LPSTR szHost); +static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString); +#endif /* sendmail_h */ |