ProcessStream example


        parent::__construct($dispatcher$logger);

        if (null !== $command) {
            if (!str_contains($command, ' -bs') && !str_contains($command, ' -t')) {
                throw new \InvalidArgumentException(sprintf('Unsupported sendmail command flags "%s"; must be one of "-bs" or "-t" but can include additional flags.', $command));
            }

            $this->command = $command;
        }

        $this->stream = new ProcessStream();
        if (str_contains($this->command, ' -bs')) {
            $this->stream->setCommand($this->command);
            $this->transport = new SmtpTransport($this->stream, $dispatcher$logger);
        }
    }

    public function send(RawMessage $message, Envelope $envelope = null): ?SentMessage
    {
        if ($this->transport) {
            return $this->transport->send($message$envelope);
        }

        
Home | Imprint | This part of the site doesn't use cookies.