2015-01-03 09:22:58 +00:00
|
|
|
/*
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2014-09-19 16:33:14 +00:00
|
|
|
| PHP Version 7 |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2018-01-02 04:57:58 +00:00
|
|
|
| Copyright (c) 1997-2018 The PHP Group |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 12:51:34 +00:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
2000-07-24 01:40:02 +00:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-10 20:04:29 +00:00
|
|
|
| available through the world-wide-web at the following url: |
|
2006-01-01 12:51:34 +00:00
|
|
|
| http://www.php.net/license/3_01.txt |
|
2000-07-24 01:40:02 +00:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2002-02-28 08:29:35 +00:00
|
|
|
| Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
|
1999-04-17 00:37:12 +00:00
|
|
|
+----------------------------------------------------------------------+
|
2000-07-24 01:40:02 +00:00
|
|
|
*/
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2000-07-03 00:41:19 +00:00
|
|
|
#ifndef PHP_MAIL_H
|
|
|
|
#define PHP_MAIL_H
|
2000-03-06 20:37:11 +00:00
|
|
|
|
2002-08-08 17:53:52 +00:00
|
|
|
PHP_FUNCTION(mail);
|
2016-09-14 21:26:31 +00:00
|
|
|
PHP_FUNCTION(ezmlm_hash);
|
|
|
|
|
2002-08-08 17:53:52 +00:00
|
|
|
PHP_MINFO_FUNCTION(mail);
|
|
|
|
|
2016-09-14 21:26:31 +00:00
|
|
|
PHPAPI zend_string *php_mail_build_headers(zval *headers);
|
2014-12-13 22:06:14 +00:00
|
|
|
PHPAPI extern int php_mail(char *to, char *subject, char *message, char *headers, char *extra_cmd);
|
1999-04-17 00:37:12 +00:00
|
|
|
|
2016-09-14 21:26:31 +00:00
|
|
|
#define PHP_MAIL_BUILD_HEADER_CHECK(target, s, key, val) \
|
|
|
|
do { \
|
|
|
|
if (Z_TYPE_P(val) == IS_STRING) { \
|
|
|
|
php_mail_build_headers_elem(&s, key, val); \
|
|
|
|
} else if (Z_TYPE_P(val) == IS_ARRAY) { \
|
|
|
|
if (!strncasecmp(target, ZSTR_VAL(key), ZSTR_LEN(key))) { \
|
|
|
|
php_error_docref(NULL, E_WARNING, "'%s' header must be at most one header. Array is passed for '%s'", target, target); \
|
|
|
|
continue; \
|
|
|
|
} \
|
|
|
|
php_mail_build_headers_elems(&s, key, val); \
|
|
|
|
} else { \
|
|
|
|
php_error_docref(NULL, E_WARNING, "Extra header element '%s' cannot be other than string or array.", ZSTR_VAL(key)); \
|
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
|
|
|
|
#define PHP_MAIL_BUILD_HEADER_DEFAULT(s, key, val) \
|
|
|
|
do { \
|
|
|
|
if (Z_TYPE_P(val) == IS_STRING) { \
|
|
|
|
php_mail_build_headers_elem(&s, key, val); \
|
|
|
|
} else if (Z_TYPE_P(val) == IS_ARRAY) { \
|
|
|
|
php_mail_build_headers_elems(&s, key, val); \
|
|
|
|
} else { \
|
|
|
|
php_error_docref(NULL, E_WARNING, "Extra header element '%s' cannot be other than string or array.", ZSTR_VAL(key)); \
|
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
|
|
|
|
|
2000-07-03 00:41:19 +00:00
|
|
|
#endif /* PHP_MAIL_H */
|