mb_send_mail 发送编码过的邮件
发表日期:2021-07-01 08:55:53 | 来源: | | 浏览(942) 分类:多字节字符串 函数
mb_send_mail
(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)
mb_send_mail — 发送编码过的邮件
说明
string
$to
,string
$subject
,string
$message
,string
$additional_headers
= null
,string
$additional_parameter
= null
): bool
发送邮件。邮件头和内容根据 mb_language() 设置来转换编码。 这是 mail() 的一个包装器函数,所以详情参见 mail()。
参数
-
to
-
被发送到该邮件地址。可通过逗号分隔地址的
to
来指定多个收件人。 该参数不会被自动编码。 -
subject
-
邮件标题。
-
message
-
邮件消息。
-
additional_headers
(可选) -
String to be inserted at the end of the email header.
This is typically used to add extra headers (From, Cc, and Bcc). Multiple extra headers should be separated with a CRLF (\r\n). Validate parameter not to be injected unwanted headers by attackers.
注意:
When sending mail, the mail must contain a
From
header. This can be set with theadditional_headers
parameter, or a default can be set in php.ini.Failing to do this will result in an error message similar to
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing
. TheFrom
header sets alsoReturn-Path
under Windows.注意:
If messages are not received, try using a LF (\n) only. Some Unix mail transfer agents (most notably » qmail) replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822.
-
additional_parameter
-
additional_parameter
是一个 MTA 命令行参数。 在使用 sendmail 时对设置正确的返回路径头很有帮助。This parameter is escaped by escapeshellcmd() internally to prevent command execution. escapeshellcmd() prevents command execution, but allows to add addtional parameters. For security reason, this parameter should be validated.
Since escapeshellcmd() is applied automatically, some characters that are allowed as email addresses by internet RFCs cannot be used. Programs that are required to use these characters mail() cannot be used.
The user that the webserver runs as should be added as a trusted user to the sendmail configuration to prevent a 'X-Warning' header from being added to the message when the envelope sender (-f) is set using this method. For sendmail users, this file is /etc/mail/trusted-users.
返回值
成功时返回 true
, 或者在失败时返回 false
。
- PHP(0)
- PHP杂项(34)
- PHP基础-李炎恢系列课程(20)
- 中文函数手册(0)
- 错误处理 函数(13)
- OPcache 函数(6)
- PHP 选项/信息 函数(54)
- Zip 函数(10)
- Hash 函数(15)
- OpenSSL 函数(63)
- Date/Time 函数(51)
- 目录函数(9)
- Fileinfo 函数(6)
- iconv 函数(11)
- 文件系统函数(81)
- 多字节字符串 函数(57)
- mb_check_encoding 检查字符串在指定的编码里是否有效(0)
- mb_convert_case 对字符串进行大小写转换(0)
- mb_convert_encoding 转换字符的编码(0)
- mb_convert_kana Convert "kana" one from another ("zen-kaku", "han-kaku" and more)(0)
- mb_convert_variables 转换一个或多个变量的字符编码(0)
- mb_decode_mimeheader 解码 MIME 头字段中的字符串(0)
- mb_decode_numericentity 根据 HTML 数字字符串解码成字符(0)
- mb_detect_encoding 检测字符的编码(0)
- mb_detect_order 设置/获取 字符编码的检测顺序(0)
- mb_encode_mimeheader 为 MIME 头编码字符串(0)
- mb_encode_numericentity Encode character to HTML numeric string reference(0)
- mb_encoding_aliases Get aliases of a known encoding type(0)
- mb_ereg_match Regular expression match for multibyte string(0)
- mb_ereg_replace_callback Perform a regular expression search and replace with multibyte support using a callback(0)
- mb_ereg_replace Replace regular expression with multibyte support(0)
- mb_ereg_search_getpos Returns start point for next regular expression match(0)
- mb_ereg_search_getregs Retrieve the result from the last multibyte regular expression match(0)
- mb_ereg_search_init Setup string and regular expression for a multibyte regular expression match(0)
- mb_ereg_search_pos Returns position and length of a matched part of the multibyte regular expression for a predefined multibyte string(0)
- mb_ereg_search_regs Returns the matched part of a multibyte regular expression(0)
- mb_ereg_search_setpos Set start point of next regular expression match(0)
- mb_ereg_search Multibyte regular expression match for predefined multibyte string(0)
- mb_ereg Regular expression match with multibyte support(0)
- mb_eregi_replace Replace regular expression with multibyte support ignoring case(0)
- mb_eregi Regular expression match ignoring case with multibyte support(0)
- mb_get_info 获取 mbstring 的内部设置(0)
- mb_http_input 检测 HTTP 输入字符编码(0)
- mb_http_output 设置/获取 HTTP 输出字符编码(0)
- mb_internal_encoding 设置/获取内部字符编码(0)
- mb_language 设置/获取当前的语言(0)
- mb_list_encodings 返回所有支持编码的数组(0)
- mb_output_handler 在输出缓冲中转换字符编码的回调函数(0)
- mb_parse_str 解析 GET/POST/COOKIE 数据并设置全局变量(0)
- mb_preferred_mime_name 获取 MIME 字符串(0)
- mb_regex_encoding Set/Get character encoding for multibyte regex(0)
- mb_regex_set_options Set/Get the default options for mbregex functions(0)
- mb_scrub Description(0)
- mb_send_mail 发送编码过的邮件(0)
- mb_split 使用正则表达式分割多字节字符串(0)
- mb_str_split Given a multibyte string, return an array of its characters(0)
- mb_strcut 获取字符的一部分(0)
- mb_strimwidth 获取按指定宽度截断的字符串(0)
- mb_stripos 大小写不敏感地查找字符串在另一个字符串中首次出现的位置(0)
- mb_stristr 大小写不敏感地查找字符串在另一个字符串里的首次出现(0)
- mb_strlen 获取字符串的长度(0)
- mb_strpos 查找字符串在另一个字符串中首次出现的位置(0)
- mb_strrchr 查找指定字符在另一个字符串中最后一次的出现(0)
- mb_strrichr 大小写不敏感地查找指定字符在另一个字符串中最后一次的出现(0)
- mb_strripos 大小写不敏感地在字符串中查找一个字符串最后出现的位置(0)
- mb_strrpos 查找字符串在一个字符串中最后出现的位置(0)
- mb_strstr 查找字符串在另一个字符串里的首次出现(0)
- mb_strtolower 使字符串小写(0)
- mb_strtoupper 使字符串大写(0)
- mb_strwidth 返回字符串的宽度(0)
- mb_substitute_character 设置/获取替代字符(0)
- mb_substr_count 统计字符串出现的次数(0)
- mb_substr 获取部分字符串(0)
- GD 和图像处理 函数(114)
- 可交换图像信息(5)
- Math 函数(50)
- 程序执行函数(11)
- PCNTL 函数(23)
- JSON 函数(4)
- SPL 函数(15)
- URL 函数(10)
- cURL 函数(32)
- 网络 函数(33)
- FTP 函数(36)
- Session 函数(23)
- PCRE 函数(11)
- PCRE 正则语法(19)
- 数组 函数(81)
- 类/对象 函数(18)
- 函数处理 函数(13)
- 变量处理 函数(37)
- SimpleXML 函数(3)
- 杂项 函数(31)
- 字符串 函数(101)