使用PHP的Sendgrid不发送电子邮件

时间:2016-05-31 04:31:28

标签: php

以下是在PHP中使用Sendgrid发送电子邮件的代码。我去过Sendgrid文档。但我无法找到解决方案。提前谢谢。

<? php
require 'vendor/autoload.php';
require 'sendgrid-php/lib/SendGrid.php';
require 'sendgrid-php/lib/SendGrid/Email.php';
require 'sendgrid-php/lib/SendGrid/Response.php';
$sendgrid = new SendGrid('8ZArX0z3S6qOi1-xxxxx');

$email = new SendGrid\Email();
$email
    ->addTo("xxx@yahoo.com")
    ->setFrom("xxx@yahoo.com")
    ->setSubject("Subject goes here")
    ->setText("Hello World!")
    ->setHtml("<strong>Hello World!</strong>");

    $sendgrid->send($email);
?>

0 个答案:

没有答案
相关问题