小编tho*_*hom的帖子

调用 /sendgrid-php/lib/helpers/mail/Mail.php 第 729 行中未定义的函数 SendGrid\mb_convert_encoding()

我该如何解决这个问题?

调用 /sendgrid-php/lib/helpers/mail/Mail.php 第 729 行中未定义的函数 SendGrid\mb_convert_encoding()

这是我的代码

<?php

require("./sendgrid-php/sendgrid-php.php");

$from = new SendGrid\Email(null, "example@example.com");
$subject = "Sending with SendGrid is Fun";
$to = new SendGrid\Email(null, "example@example.com");
$content = new SendGrid\Content("text/plain", "and easy to do anywhere, even with PHP");

// Send message as html
$mail = new SendGrid\Mail($from, $subject, $to, $content);

$apiKey = getenv('my key');
$sg = new \SendGrid($apiKey);

$response = $sg->client->mail()->send()->post($mail);

echo $response->statusCode();

print_r($response->headers());

echo $response->body();
Run Code Online (Sandbox Code Playgroud)

php email sendgrid-api-v3

2
推荐指数
1
解决办法
1792
查看次数

标签 统计

email ×1

php ×1

sendgrid-api-v3 ×1