php - Send email from magento2 -


i'm trying send email code in magento 2 below:

$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()); } 

i getting follow error: array ( [type] => 8 [message] => unserialize(): error @ offset 0 of 1 bytes [file] => /var/www/html/app/code/magiccart/alothemes/view/frontend/templates/themecfg.phtml [line] => 17 )

can tell me what's i'm wrong?

thanks.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -