Search code examples
phplaravelswiftmailerpassword-recovery

Paperwork issues - Swift_TransportException 'Cannot send message without a sender address'


The thrown exception

I have a virtual machine running paperwork from GitHub, I use it in my organization for users to write notes but now I've run into an issue with the password recovery, when I try to ask for a password recovery this happens:

I'm getting the 'Cannot send message without a sender address' exception from the swift mailer, I can't seem to find where to set up the sender address.

I have tried to specify the sender in the message creation function in message.php as $this->setFrom('[email protected]'); This makes the exception go away but I don't receive any password recovery mail sent to my inbox.


Solution

  • You need to make sure you have set the from in app/config/mail.php

    'from' => ['address' => '[email protected]', 'name' => 'myname']
    

    And don't forget to do php artisan config:cache after.