Jump to content

PEAR MIME problems


lummi

Recommended Posts

Hello all freaks!  ;D

I'm a n00b so please have understanding if my question is little bit wierd.
I am using PearMailfactory and sending out newsletters and different emails to users.
Therer is one problem though, and that is when sending to yahoo mail accounts - the email body is blank (however if I "save page as" and save page .html the message is visable)
Works ok with gmail and hotmail but not yahoo.

Here is the code:

[code]/*Parsing template with selected template and user*/
        function parseTemplate()
        {
                $this->_parsed_template['subject'] = $this->_smarty->fetch('db:'.$this->_template['subject'].$this->_language_id);
                $this->_parsed_template['text'] = $this->_smarty->fetch('db:'.$this->_template['text'].$this->_language_id);
        }

        /*Set text and subject of message directly from methods values*/
        function setMessage($subject, $text)
        {
                if (!$subject || !$text)
                        die(TEXT_OR_SUBJECT_NOT_DEFINED);
                $this->_parsed_template['subject'] = $subject;
                $this->_parsed_template['text'] = $text;
        }

function sendMail($email = false)
        {
                if (!$this->_hdrs['From'])
                        $this->setFrom(PROJECT_INFO_EMAIL);
                if (!$email)
                        $email = $this->_users[0]['email'];
                $this->setHTMLBody($this->_parsed_template['text']);
                $this->_hdrs['Subject'] = $this->_parsed_template['subject'];
                if (defined('MAIL_CHARSET'))
                        list($charsets['head_charset'], $charsets['text_charset'], $charsets['html_charset']) =
                                Array(MAIL_CHARSET, MAIL_CHARSET, MAIL_CHARSET);
                $body = $this->get($charsets);
                $hdrs = $this->headers($this->_hdrs);
                $this->_mail->send($email, $hdrs, $body);[/code]
   

So why is the message not visable in yahoo mail???
Would appriciate if someone could help me out here. The templates that is parsed reside in the db, do I have to add a <body> tag or something in the template?

Regards,
Lummi
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.