php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
mail.c File Reference
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#include <time.h>
#include "php.h"
#include "ext/standard/info.h"
#include "ext/standard/php_string.h"
#include "ext/standard/basic_functions.h"
#include "ext/date/php_date.h"
#include "zend_smart_str.h"
#include "php_syslog.h"
#include "php_mail.h"
#include "php_ini.h"
#include "exec.h"

Go to the source code of this file.

Macros

#define SKIP_LONG_HEADER_SEP(str, pos)
 
#define PHP_MAIL_BUILD_HEADER_CHECK(target, s, key, val)
 
#define MAIL_RET(val)
 

Enumerations

enum  php_mail_header_value_error_type {
  NO_HEADER_ERROR , CONTAINS_LF_ONLY , CONTAINS_CR_ONLY , CONTAINS_CRLF ,
  CONTAINS_NULL
}
 

Functions

zend_long php_getuid (void)
 
PHPAPI zend_stringphp_mail_build_headers (HashTable *headers)
 
 PHP_FUNCTION (mail)
 
PHPAPI bool php_mail (const char *to, const char *subject, const char *message, const char *headers, const char *extra_cmd)
 
 PHP_MINFO_FUNCTION (mail)
 

Macro Definition Documentation

◆ MAIL_RET

#define MAIL_RET ( val)
Value:
if (ahdr != NULL) { \
efree(ahdr); \
} \
return val; \
zval * val
Definition ffi.c:4262
#define NULL
Definition gdcache.h:45

◆ PHP_MAIL_BUILD_HEADER_CHECK

#define PHP_MAIL_BUILD_HEADER_CHECK ( target,
s,
key,
val )
Value:
do { \
if (Z_TYPE_P(val) == IS_STRING) { \
php_mail_build_headers_elem(&s, key, val); \
} else if (Z_TYPE_P(val) == IS_ARRAY) { \
zend_type_error("Header \"%s\" must be of type string, array given", target); \
break; \
} \
php_mail_build_headers_elems(&s, key, val); \
} else { \
zend_type_error("Header \"%s\" must be of type array|string, %s given", ZSTR_VAL(key), zend_zval_value_name(val)); \
} \
} while(0)
char s[4]
Definition cdf.c:77
unsigned char key[REFLECTION_KEY_LEN]
ZEND_API const char * zend_zval_value_name(const zval *arg)
Definition zend_API.c:148
#define ZSTR_VAL(zstr)
Definition zend_string.h:68
#define zend_string_equals_literal_ci(str, c)
#define Z_TYPE_P(zval_p)
Definition zend_types.h:660
#define IS_STRING
Definition zend_types.h:606
#define IS_ARRAY
Definition zend_types.h:607

Definition at line 192 of file mail.c.

◆ SKIP_LONG_HEADER_SEP

#define SKIP_LONG_HEADER_SEP ( str,
pos )
Value:
if (str[pos] == '\r' && str[pos + 1] == '\n' && (str[pos + 2] == ' ' || str[pos + 2] == '\t')) { \
pos += 2; \
while (str[pos + 1] == ' ' || str[pos + 1] == '\t') { \
pos++; \
} \
continue; \
} \
unsigned const char * pos
Definition php_ffi.h:52

Definition at line 48 of file mail.c.

Enumeration Type Documentation

◆ php_mail_header_value_error_type

Enumerator
NO_HEADER_ERROR 
CONTAINS_LF_ONLY 
CONTAINS_CR_ONLY 
CONTAINS_CRLF 
CONTAINS_NULL 

Definition at line 59 of file mail.c.

Function Documentation

◆ PHP_FUNCTION()

PHP_FUNCTION ( mail )

Definition at line 268 of file mail.c.

◆ php_getuid()

zend_long php_getuid ( void )
extern

Definition at line 72 of file pageinfo.c.

◆ php_mail()

PHPAPI bool php_mail ( const char * to,
const char * subject,
const char * message,
const char * headers,
const char * extra_cmd )

Definition at line 439 of file mail.c.

◆ php_mail_build_headers()

PHPAPI zend_string * php_mail_build_headers ( HashTable * headers)

Definition at line 207 of file mail.c.

◆ PHP_MINFO_FUNCTION()

PHP_MINFO_FUNCTION ( mail )

Definition at line 624 of file mail.c.