The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Sending HTML + text emails : content-type line appears to the 2nd recipient - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Sending HTML + text emails : content-type line appears to the 2nd recipient (/showthread.php?tid=647)



Sending HTML + text emails : content-type line appears to the 2nd recipient - liberio - Apr 10th, 2010

Hi Form Tools community,

First of all I want to thank you for what you have done, it is a great piece of work!

I encountered an issue last week. A line always appears in the notifications when sending multipart email to more than 2 clients:
PHP Code:
Content-Type:multipart/alternativeboundary xXxXxXxXxXxXxXxXxXxXxXxXxXxX 
It occurs to all notifications except for the first adding client.

I do not know if this is a minor bug or a bad use of this feature. Perhaps I've done something wrong or missed some other setting.

Do you have any idea about this ?

Let me know if you need more details, like steps to reproduce.

Thanks in advance for your help.


RE: Sending HTML + text emails : content-type line appears to the 2nd recipient - Ben - Apr 10th, 2010

Hi Liberio,

That sounds like a bug, not a misconfiguration on your part!

First off, are you using the Swift Mailer plugin or the default mail functionality? If the latter, I'd suggest looking into Swift to send the emails - chances are this problem will "magically" disappear.... PHP mail() is pretty awful. Smile

But yes, if you could provide instructions on how to reproduce it, I could test it out on my own system - at least to just confirm it's not an endemic problem with Form Tools itself.

Thanks!

- Ben


RE: Sending HTML + text emails : content-type line appears to the 2nd recipient - liberio - Apr 11th, 2010

Swift Mailer module is unavailable because I use Form Tools 1.5.1...
The issue comes from ft_send_email() function located in global/code/emails.php. Here is the code I modified to correct the bug:
PHP Code:
// ADVANCED emails (email templates)
else
{
    
$headers_completed false;

    
// loop through each client assigned to this form, and generate an email for them
    
for ($i=0$i<count($user_info); $i++)
    {
        
$client_placeholders _ft_get_placeholder_hash($form_id$submission_id$user_info[$i]);
        switch (
$email_template)
        {
            case 
"both":
                
$text_content _ft_parse_template($form_info["{$email_type}_text_email_template"], $client_placeholders);
                
$HTML_content _ft_parse_template($form_info["{$email_type}_html_email_template"], $client_placeholderstrue);
                if (!
$headers_completed
                    
$headers .= _ft_get_multipart_message($HTML_content$text_content$eol);
                break;

            case 
"text":
                
$message _ft_parse_template($form_info["{$email_type}_text_email_template"], $client_placeholders);
                if (!
$headers_completed
                    
$headers .= "Content-type: text/plain; charset=UTF-8";
                break;

            case 
"html":
                
$message _ft_parse_template($form_info["{$email_type}_html_email_template"], $client_placeholderstrue);
                if (!
$headers_completed
                    
$headers .= "Content-type: text/html; charset=UTF-8";
                break;
        }

        
$headers_completed true;

        
// only send an email to this client if they have an actual email address specified and
        
if (!empty($user_info[$i]['email']) && $clients_may_manage_submission[$user_info[$i]["user_id"]])
            
$email_info[] = array($user_info[$i]['email'], $subject$message$headers);

        
// if required, send an additional email to the site administrator (but NEVER when just testing)
        
if (empty($override_recipient) && $email_type == "admin" && $form_info['include_admin_email'] == "yes")
            
$email_info[] = array($settings['administrator_email'], $subject$message$headers);
    }


Do this patch seems correct to you ?

Steps to reproduce:
Create a form -> Create 2 clients -> Add the 2 clients to the form -> In Emails tab check "Send email notifications to clients for form submissions" -> Select "Text & HTML" emails format(s) -> Select "Full form submission" for client Text and HTML templates -> Update -> Fill in the form and send a submission


RE: Sending HTML + text emails : content-type line appears to the 2nd recipient - Ben - Apr 18th, 2010

Oh, I see... I'm afraid I really don't support FT1 any more. I haven't touched the code for a looong time.

You could try searching the FT1 forums for a solution:
http://ft1.formtools.org/forums/

Anyone else know of a fix for this?

- Ben


RE: Sending HTML + text emails : content-type line appears to the 2nd recipient - liberio - Apr 25th, 2010

I already found a solution I wrote in my last post ;-)

An equivalent solution was given in FT1 forums: http://ft1.formtools.org/forums/index.php/topic,1035.0.html

Now I wonder whether FT2 code is affected or not...

Thanks for help !


RE: Sending HTML + text emails : content-type line appears to the 2nd recipient - Ben - Apr 26th, 2010

Excellent! Smile Thanks for posting that.

- Ben