从magento2发送电子邮件

时间:2017-07-27 21:05:53

标签: php email magento2

我正在尝试从magento 2中的代码发送电子邮件,如下所示:

$testo_email = '';
ini_set("sendmail_from", "noreply@test.com");
$from = "Sito Web www.test.com";

$oggetto = "Richiesta di contatto da sito";

$header = "From: indirizzo sito web <www.test.com>\n";
$header .= "X-Mailer: Il nostro Php\n";
$header .= "MIME-Version: 1.0\n";
$header .= "Content-Type: text/html; charset=\"utf-8\"\n";
$header .= "Content-Transfer-Encoding: 7bit\n\n";

if(mail('mymail@gmail.com', $oggetto, $testo_email, $header)){
echo("Your message has been sent successfully");
} else {
print_r(error_get_last());
}

我回复了以下错误: 数组([type] =&gt; 8 [message] =&gt; unserialize():偏移0错误1个字节[file] =&gt; / var / www / html / app / code / Magiccart / Alothemes / view / frontend /templates/themecfg.phtml [line] =&gt; 17)

有人可以告诉我,我错了吗?

感谢。

0 个答案:

没有答案