RoGeR_ThAt
RoGeR_ThAt

Reputation: 127

zend mail giving mail in unreadable format when using in magento

Used the following code.

$mail = new Zend_Mail();
$mail->setBodyHtml($message)
->setFrom('[email protected]', 'abc')
->addTo($to, 'admin')
->setSubject($subj);

This is the part i wrote.

I am getting proper html in $message. The $ variable used above are from retrieved post value. The mail which I am receiving contains contents like :

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

in the starting part rest all the mail content are fine.
Thanks in advance

Upvotes: 4

Views: 398

Answers (1)

Nikhil_K_R
Nikhil_K_R

Reputation: 2373

From myunderstanding,i conclude with this part utf-8 adding in your code

$mail = new Zend_Mail('utf-8');
$mail->setBodyHtml($message)
->setFrom('[email protected]', 'abc')
->addTo($to, 'admin')
->setSubject($subj);

Hope this helps you.

Upvotes: 1

Related Questions