如何在没有标题的情况下编写wp_mail

时间:2013-08-01 05:28:55

标签: wordpress php

没有标题写wp_mail是否可以?

该功能的用法是 <?php wp_mail( $to, $subject, $message, $headers, $attachments ); ?>

问:我可以这样使用吗? <?php wp_mail( $to, $subject, $message); ?>

3 个答案:

答案 0 :(得分:4)

是的,你可以使用它:

<?php wp_mail( $to, $subject, $message); ?>

$ header和$ attachments默认为空(它们是optionnal)。

答案 1 :(得分:4)

是的,如果您查看下面的文字,则参数$headers会显示其(string or array) (optional)

$to
(string or array) (required) The intended recipient(s). Multiple recipients may be specified using an array or a comma-separated string.
Default: None

$subject
(string) (required) The subject of the message.
Default: None

$message
(string) (required) Message content.
Default: None

$headers
(string or array) (optional) Mail headers to send with the message. (advanced)
Default: Empty

$attachments
(string or array) (optional) Files to attach: a single filename, an array of filenames, or a newline-delimited string list of multiple filenames. (advanced)
Default: Empty

来源:http://codex.wordpress.org/Function_Reference/wp_mail#Parameters

答案 2 :(得分:0)

是的,你可以像这样使用

<?php wp_mail( $to, $subject, $message); ?>

$ headers是可选参数