Welcome Guest, Not a member yet? Register   Sign In
BCC Batch Mode Destroys Email in Subsequent Batches
#1

[eluser]Unknown[/eluser]
When using BCC Batch Mode the first batch of recipients get a good version of the email and the second batch of recipients get a messed up version. Here's example source from the emails:

Source from an email delivered to a recipient in the first batch (the way the email was intended to be delivered):
Code:
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_4a8f2d8df2a68
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Here's a test message compiled in TinyMCE and sent in bcc batch mode using
CodeIgniter.To unsubscribe from future mailings please click here or follow
this
URL:http://www.[xxxxxxxxxxxxxxxx].com/index.php/group_mailer/unsubscribe


--B_ALT_4a8f2d8df2a68
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

&lt;html&gt;&lt;head>&lt;title&gt;&lt;/title>&lt;/head&gt;&lt;body><p>Here's a test message compiled i=
n TinyMCE and sent in bcc batch mode using CodeIgniter.</p><br /><br /><br =
/><p style=3D"color:#888; font-size:9px;">To unsubscribe from future mailin=
gs please <a >click here</a> or follow this URL:<br >http://www.[xxxxxxxx=
xxxxxxxx].com/index.php/group_mailer/unsubscribe</p>&lt;/body&gt;&lt;/html>

--B_ALT_4a8f2d8df2a68--

Source from an email delivered to a recipient in the second batch (here's where it gets messy)
Code:
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_4a8f2d8e03df1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Here's a test message compiled i=
n TinyMCE and sent in bcc batch mode using CodeIgniter.To unsubscribe from
future mailin=
gs please click here or follow this URL:http://www.[xxxxxxxx=
xxxxxxxx].com/index.php/group_mailer/unsubscribe


--B_ALT_4a8f2d8e03df1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

&lt;html&gt;&lt;head>&lt;title&gt;&lt;/title>&lt;/head&gt;&lt;body><p>Here's a test message compiled i=
=3D
n TinyMCE and sent in bcc batch mode using CodeIgniter.</p><br /><br /><br =
=3D
/><p style=3D3D"color:#888; font-size:9px;">To unsubscribe from future mail=
in=3D
gs please <a >click here</a> or follow this URL:<br >http://www.[xxxxxxxx=
=3D
xxxxxxxx].com/index.php/group_mailer/unsubscribe</p>&lt;/body&gt;&lt;/html>

--B_ALT_4a8f2d8e03df1--

It almost looks like the second batch goes through a prep function twice instead of once. Anyone have any ideas on how to fix this? I'm using CI 1.7.1.

Also - this is what happens to the subject (it gets removed):
Code:
Subject: =?ISO-8859-1?Q?Test_Subject?=
Turns into:
Code:
Subject:
#2

[eluser]Steerlin[/eluser]
Hi, I've also come accross this bug

I've temporarily resolved it by changing the following code:

Code:
/**
     * Write Headers as a string
     *
     * @access    private
     * @return    void
     */
    function _write_headers()
    {
        if ($this->protocol == 'mail')
        {
            $this->_subject = $this->_headers['Subject'];
//            unset($this->_headers['Subject']);
        }

        reset($this->_headers);
        $this->_header_str = "";

        foreach($this->_headers as $key => $val)
        {
            $val = trim($val);

            if ($val != "")
            {
                $this->_header_str .= $key.": ".$val.$this->newline;
            }
        }

        if ($this->_get_protocol() == 'mail')
        {
            $this->_header_str = rtrim($this->_header_str);
        }
    }

because if you unset $this->_headers['Subject'] it won't be available for the next batch, hence only the first one works as advertised
#3

[eluser]Unknown[/eluser]
Thank you, thank you for this it was a huge problem until I saw this thread, I was sending out 1500 emails in bcc batches of 200 and only the first batch was okay. Couldnt get that solution above to work, but just turned of batching and ran everything thru a loop clear and setting up the emails each time in my script which is fine.




Theme © iAndrew 2016 - Forum software by © MyBB