• I’m seeing this error for pretty much every email that’s sent out. I have it configured to use SendGrid’s API.

    After that error occurs, the next error to show up is that it tries to send an email, unsuccessfully, to smtp:none:none://localhost:25, and then it actually sends the email via https://api.sendgrid.com:443.

    Any ideas what’s happening?

    Thanks,
    AJ

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ajtatum

    (@ajtatum)

    So, for now I went into PostmanSendGridMailEngine.php and disabled the lines that try to add CC addresses.

    $ccEmails = array();
    //foreach ( ( array ) $message->getCcRecipients() as $recipient ) {
    //    if ( ! in_array( $recipient->getEmail(), $duplicates ) ) {
    //        $recipient->log($this->logger, 'Cc');
    //        $ccEmails[] = new \SendGrid\Mail\Cc($recipient->getEmail(), $recipient->getName());
    //        $duplicates[] = $recipient->getEmail();
    //    }
    //}
    $email->addCcs($ccEmails);

    Hi @ajtatum,

    Sorry that I am only just getting around to reading your forum post and replying to you. I have been super busy lately, and this is the first opportunity I’ve had to respond.

    I am going to flag this to the developer for attention.

    Kind Regards,
    Tim

    @yehudah – issue with SendGrid

    Dave Norris

    (@givingbacksmiles)

    I am having this same issue. Saying it is an issue with SendGrid does not help much.

    After looking into it, the array ccEmails and bccEmails both return empty and then throw the error mentioned above.

    @tneville the answer you gave is basically like saying, “Welp – I guess you will not be using SendGrid with Post SMTP then.” Yikes!!

    // add the cc recipients
                $ccEmails = array();
    			foreach ( ( array ) $message->getCcRecipients() as $recipient ) {
                    if ( ! in_array( $recipient->getEmail(), $duplicates ) ) {
                        $recipient->log($this->logger, 'Cc');
                        $ccEmails[] = new \SendGrid\Mail\Cc($recipient->getEmail(), $recipient->getName());
                        $duplicates[] = $recipient->getEmail();
                    }
    			}
                $email->addCcs($ccEmails);
    
                // add the bcc recipients
                $bccEmails = array();
    			foreach ( ( array ) $message->getBccRecipients() as $recipient ) {
                    if ( ! in_array( $recipient->getEmail(), $duplicates ) ) {
                        $recipient->log($this->logger, 'Bcc');
                        $bccEmails[] = new \SendGrid\Mail\Bcc($recipient->getEmail(), $recipient->getName());
                        $duplicates[] = $recipient->getEmail();
                    }
    			}
                $email->addBccs($bccEmails);
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Number of elements in “$ccEmails” can not be less than 1.’ is closed to new replies.