'"User is not set" IncompleteDsnException after migrating to Laravel 9
I was using Laravel 8.64, and my emails were working fine both on prod and dev servers. However, after upgrading to 9.0.2, I have an issue with sending emails. Of course, I followed all instructions, but still, I get errors when I try to send an email.
User is not set. {"exception":"[object] (Symfony\Component\Mailer\Exception\IncompleteDsnException(code: 0): User is not set.
After some reasearch in vendor folder i found class AbstractTransportFactory that contains getUser method.
protected function getUser(Dsn $dsn): string
{
$user = $dsn->getUser();
if (null === $user) {
throw new IncompleteDsnException('User is not set.');
}
return $user;
}
When I return ''; in this if statement, everything is working fine instead of throwing an exception. Does anyone know the solution for this and why this is happening
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
