Send email from task

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Boom
    Junior Member
    • Oct 2018
    • 5

    Send email from task

    Hello.

    Need send email from arhive. I try use Email service, but arhive mail dont have "from" (field fill at panel).
  • Boom
    Junior Member
    • Oct 2018
    • 5

    #2
    "To" field empty too. But PDO (SELECT name FROM email_address JOIN email_email_address ON (email_address_id = email_address.id) WHERE email_id = :email_id) is working :\

    Comment

    • Boom
      Junior Member
      • Oct 2018
      • 5

      #3
      Send mail from arhive. Total:

      PHP Code:
      $mail = $this->getEntityManager()->getEntity('Email', $id);
      $sender->send($mail); 
      

      Not working (Zend\Mail\Transport\Smtp transport expects at least one recipient if the message has at least one header or body).

      PHP Code:
      $newMail = $this->getEntityManager()->getEntity('Email');
      $newMail->populateFromArray($mail->toArray());
      $newMail->set([ 'from' => $fromAddressRecvPDO,
      'to' => implode(';', $toAddressesRecvPDO), ]);
      $sender->send($newMail); 
      

      Working.

      Comment

      Working...