【发布时间】:2018-09-20 13:04:52
【问题描述】:
我正在尝试使用 Mailgun 发送邮件。如果我这样写:
$mg = Mailgun::create('xxxx');
$mg->messages()->send('xxxx', [
'from' => 'dmt.akyol@gmail.com',
'to' => 'dmt.akyol@gmail.com',
'subject' => 'Your Link To Login!',
'text' => 'hello',
]);
它有效,但我想发送一个视图(刀片)但我不知道该怎么做。
我的代码是:
public function build(array $customer)
{
return view('link')->with([
'customer'=> $customer,
]);
}
public function sendContactForm(array $customer)
{
$aaa=$this->build($customer);
$mg = Mailgun::create('xxxxxx')
$mg->messages()->send('xxxx'), [
'from' => $customer['customerEmail'],
'to' => ' dmt.akyol@gmail.com',
'subject' => 'Contact Message',
'html' => $aaa,
]);
}
当我写 html 或 text 时,这不起作用。
我该怎么办?
【问题讨论】:
-
你去...删除了downvote。
-
我刚刚补充了抱歉..
标签: php laravel laravel-blade mailgun laravel-mail