Error while sending an email


When I am trying to send an email I’ve got an error
in vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php (line 445) Expected response code 250 but got an empty response

I use regular code from my previous projects.
$mail = new \Pimcore\Mail(); $mail->addTo(''); $emailDocument = Document::getById(14); $mail->setDocument($emailDocument); $mail->send();

I set in setting Mail method and fill the email sender.

Are you using gmail ID to send emails? then maybe try to allow less secure apps option

Continuing the discussion from Error while sending an email:

I resolved it by using SMTP settings