src/MimeMailer/Mailer.php
public function setTransporter(TransportInterface $transporter)
    {
        if ($transporter->validate()) {
            $this->transporter = $transporter;
        } else {
            throw new \Exception(
                sprintf('Transporter "%s" is not valid for current environment!', get_class($transporter))
            );
        }
        return $this;
    }
public function setTransporter(TransportInterface $transporter)
    {
        if ($transporter->validate()) {
            $this->transporter = $transporter;
        } else {
            throw new \Exception(
                sprintf('Transporter "%s" is not valid for current environment!', get_class($transporter))
            );
        }
        return $this;
    }
Set a transporter

@param \MimeMailer\TransportInterface $transporter
@return self
@throws \Exception if the default `transporter::validate()` does not return `true`