Home > Backend Development > PHP Tutorial > Sendcloud的x_smtpapi具体如何定义?

Sendcloud的x_smtpapi具体如何定义?

WBOY
Release: 2016-06-06 20:45:42
Original
1422 people have browsed it

正在用搜狐的Sendcloud发邮件,用x_smtpapi定义收件人。文档严重不足……和客服试了几次都不行。代码:

<code>    $recipient = "'123456@qq.com', '789011@qq.com'";
    $title = $this->input->post('title');
    $body = $this->input->post('body');
    $x_smtpapi = json_encode(array(
        "to" => $recipient));

    $data=
    array(
    'api_user'=>'postmaster@conglinwang.sendcloud.org',
    'api_key' =>'XXXX',
    'from'=>'xxxx',
    'fromname'=>'xxxxx',
    'subject'=>$title,
    'html'=>$body,
    'x_smtpapi'=>$x_smtpapi
    );
</code>
Copy after login
Copy after login

报错为:{"message":"error","errors":["Parameter x-smtpapi is not a valid json stringjava.lang.String cannot be cast to net.sf.json.JSONArray"]}

大牛们看看。谢了!

回复内容:

正在用搜狐的Sendcloud发邮件,用x_smtpapi定义收件人。文档严重不足……和客服试了几次都不行。代码:

<code>    $recipient = "'123456@qq.com', '789011@qq.com'";
    $title = $this->input->post('title');
    $body = $this->input->post('body');
    $x_smtpapi = json_encode(array(
        "to" => $recipient));

    $data=
    array(
    'api_user'=>'postmaster@conglinwang.sendcloud.org',
    'api_key' =>'XXXX',
    'from'=>'xxxx',
    'fromname'=>'xxxxx',
    'subject'=>$title,
    'html'=>$body,
    'x_smtpapi'=>$x_smtpapi
    );
</code>
Copy after login
Copy after login

报错为:{"message":"error","errors":["Parameter x-smtpapi is not a valid json stringjava.lang.String cannot be cast to net.sf.json.JSONArray"]}

大牛们看看。谢了!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template