API示例

使用 PHP 的无 CURL POST 请求方法

<?php $url = 'https://rsXXX-api.realsender.com/mail/send'; $data = array('apiuser' =>'我们提供给您的', 'apipass' => '我们提供给您的', 'from' => 'sender@example.com', 'to' => 'recipient@example.com', 'subject' => '邮件主题', 'text' => '纯文本邮件正文', 'html' => 'HTML格式邮件正文'); // 即使您向 https:// 发送请求,也请使用键 'http'... $options = array( 'http' => array( 'header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data), ), ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); var_dump($result); ?>

POST 请求
CURL 方法

curl -d 'apiuser=我们提供给您的用户名&apipass=我们提供给您的密码&from=sender@example.com&to=recipient@example.com&subject=邮件主题&text=纯文本格式的邮件正文&html=HTML格式的邮件正文'https://rsXXX-api.realsender.com/mail/send

API示例及附件