sendmail.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #if !defined(sendmail_h) /* Sentry, use file only if it's not already included. */
  2. #define sendmail_h
  3. #include <windows.h>
  4. #define HOST_NAME_LEN 256
  5. #define MAX_APPNAME_LENGTH 100
  6. #define MAIL_BUFFER_SIZE (1024*4) /* 4k buffer */
  7. /* Return values */
  8. #define MIN_ERROR_INDEX 0 /* Always 0 like SUCCESS */
  9. #define SUCCESS 0
  10. #define FAILED_TO_PARSE_ARGUMENTS 1
  11. #define FAILED_TO_OPEN_MAILFILE 2
  12. #define FAILED_TO_START_SOCKETS 3
  13. #define FAILED_TO_RESOLVE_HOST 4
  14. #define FAILED_TO_OBTAIN_SOCKET_HANDLE 5
  15. #define FAILED_TO_CONNECT 6
  16. #define FAILED_TO_SEND 7
  17. #define FAILED_TO_RECEIVE 8
  18. #define SMTP_SERVER_ERROR 9
  19. #define FAILED_TO_GET_HOSTNAME 10
  20. #define OUT_OF_MEMORY 11
  21. #define UNKNOWN_ERROR 12
  22. #define BAD_MSG_CONTENTS 13
  23. #define BAD_MSG_SUBJECT 14
  24. #define BAD_MSG_DESTINATION 15
  25. #define BAD_MSG_RPATH 16
  26. #define BAD_MAIL_HOST 17
  27. #define BAD_MSG_FILE 18
  28. #define W32_SM_SENDMAIL_FROM_NOT_SET 19
  29. #define W32_SM_SENDMAIL_FROM_MALFORMED 20
  30. #define W32_SM_PCRE_ERROR 21
  31. #define MAX_ERROR_INDEX 22 /* Always last error message + 1 */
  32. PHPAPI int TSendMail(char *smtpaddr, int *returnerror, char **error_message,
  33. char *RPath, char *Subject, char *mailTo, char *data,
  34. char *mailCc, char *mailBcc, char *mailRPath);
  35. PHPAPI void TSMClose(void);
  36. static int SendText(char *RPath, char *Subject, char *mailTo, char *mailCc, char *mailBcc, char *data,
  37. char *headers, char *headers_lc, char **error_message);
  38. PHPAPI char *GetSMErrorText(int index);
  39. static int MailConnect();
  40. static int PostHeader(char *RPath, char *Subject, char *mailTo, char *xheaders);
  41. static int Post(LPCSTR msg);
  42. static int Ack(char **server_response);
  43. static unsigned long GetAddr(LPSTR szHost);
  44. static int FormatEmailAddress(char* Buf, char* EmailAddress, char* FormatString);
  45. #endif /* sendmail_h */
  46. /*
  47. * Local variables:
  48. * tab-width: 4
  49. * c-basic-offset: 4
  50. * End:
  51. * vim600: sw=4 ts=4 fdm=marker
  52. * vim<600: sw=4 ts=4
  53. */