Zend mail sending mail in unreadable format when used in magento

The following code is used.

$mail = new Zend_Mail(); $mail->setBodyHtml($message) ->setFrom(' abc@gty.com ', 'abc') ->addTo($to, 'admin') ->setSubject($subj); 

This is the part I wrote.

I get the correct html in $message . The $ variable used above refers to the received message. The email I receive contains the contents, for example:

AAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

In the starting part, all the contents of the mail are beautiful.
thanks in advance

+4
source share
1 answer

From my understanding, I end up with this part of utf-8 adding to your code

 $mail = new Zend_Mail('utf-8'); $mail->setBodyHtml($message) ->setFrom(' abc@gty.com ', 'abc') ->addTo($to, 'admin') ->setSubject($subj); 

Hope this helps you.

+1
source

Source: https://habr.com/ru/post/1444345/


All Articles