Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Email package not stripping BCC recipients?
  • Hi, I was using the built-in email package provided with Fuel v1.1 and it works great. But somehow the BCC recipients aren't being stripped from the headers, leaving them visible to everyone to be seen. I tested this with multiple mail clients (Mail for Mac, Sparrow and Outlook). Could this potentially be a bug? Am I doing something wrong? Code dump of my function below:
    private function mailCondolatie($condoleantie, $overledene) {
    
        $email = Email::forge();
    
        // check for valid given email address; UNTESTED CODE BLOCK
        if (filter_var($condoleantie->email, FILTER_VALIDATE_EMAIL)) {
          $email->from("uitvaartzorg@van-dael.be", "Uitvaartzorg Van Dael");
          $email->to($condoleantie->email, $condoleantie->naam);
          $email->reply_to($condoleantie->email, $condoleantie->naam); //incompatible with legacy mail package
        } else {
          throw new HttpServerErrorException;
        }
    
        // check if deceased has a family email address
        if (!empty($overledene->email_familie)) {
    
          // check of emails are seperated by dot-comma
          if (strpos($overledene->email_familie, ';')) {
            $addresses = explode(';', str_replace(' ', '', $overledene->email_familie));
          }
          // check of emails are seperated by comma
          elseif (strpos($overledene->email_familie, ',')) {
            $addresses = explode(',', str_replace(' ', '', $overledene->email_familie));
          } elseif (!strpos($overledene->email_familie, ',') and !strpos($overledene->email_familie, ';')) {
            // single email address was probably given
            $addresses = $overledene->email_familie;
          }
          $email->bcc($addresses);
        } else {
          //  no email address was given, do nothing
        }
    
        // owner's e-mail address
        $owner_email = Config::get('inmemoriam.email_administrator');
        if (!empty($owner_email) && filter_var($owner_email, FILTER_VALIDATE_EMAIL)) {
          $email->bcc($owner_email);
        } else {
          throw new Exception("Administrator email was not set or invalid.");
        }
    
        // verzender's e-mail adres
        $email->bcc($condoleantie->email, $condoleantie->naam);
        $email->subject('Nieuwe condolatie voor ' . $overledene);
    
        $data['bericht'] = $condoleantie->bericht;
        $data['afzender'] = $condoleantie->naam;
        $data['adres'] = $condoleantie->adres;
        $data['plaats'] = $condoleantie->plaats;
    
        $email->html(View::forge('mails/condolatie', $data, false));
    
        try {
          $email->send();
        } catch (EmailValidationFailedException $e) {
          throw $e;
          exit;
        } catch (EmailSendingFailedException $e) {
          throw $e;
          exit;
        }
    
  • This forum isn't really for bug reports. Please add an issue for this at http://github.com/fuel/email/issues so someone can have a look and it can be followed up.
  • Harro Verton wrote on Sunday 8th of April 2012:
    This forum isn't really for bug reports. Please add an issue for this at http://github.com/fuel/email/issues so someone can have a look and it can be followed up.

    Sorry, I wasn't sure if it was a bug or just a silly mistake I made. I'll post it in the issue tracker! EDIT: I've found the issue and I've sent a pull request.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion