php - MailGun 取消订阅
问题描述
我正在使用 PHP 的 CURL 函数使用 MailGun 返回我域中所有未订阅的电子邮件。我尝试了以下代码:
function get_unsubscriptions() {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, 'api:key-[key removed]');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_URL, 'https://api.mailgun.net/v3/[domain removed]/unsubscriptions');
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
但它只返回以下内容:
Mailgun 华丽的 API
我究竟做错了什么?
解决方案
推荐阅读
- scala - Scalafmt 配置用于在 ~> 运算符上换行
- java - 将 Angular 连接到 Spring 的 CORS 错误(localhost 8080 <--> localhost 4200)
- python - 如何在python(熊猫)中将嵌套JSON格式的特定部分解析为csv
- python - Python - 当真:尝试除其他 - 程序流问题
- flutter - Flutter:flutter_swiper 包控制幻灯片之间的空间
- php - 不知道有多少参数时的准备语句
- python - 使用 SSH 在远程计算机上打开浏览器
- javascript - 选择下拉菜单项时自动从我的数据库中填写 textarea 字段
- javascript - 将字符串与正则表达式匹配时出错
- java - 用另一个类的实例字段影响一个类的实例字段