SMTP and Sendgrid

Howdy,
I’d like to report something. I’m using Sendgrid and they do provide SMTP credentials so I can send e-mails through their server.

So I was going to set this up in Invoice Ninja and it didn’t work. Sendgrid says you should use APIKEY as the username, and the actual API key as password. But then, there is no USERNAME field in Invoice Ninja. And if I try to put APIKEY as the SENDER EMAIL ADDRESS, Invoice Ninja complains that it doesn’t follow standard mailbox naming.

I got around this by editing the .env file and putting APIKEY as username there, but it would be nice to have authentication fields separate from sender address in Invoice Ninja. SMTP providers such as Sendgrid and others do have specific authentication instructions and they usually differ from the usual username/password combination used in regular mailboxes.

Thanks for letting us know, we’ll consider this change for a future release.

@denisgomes Can you please give me more info about the workaround? I want to use sendgrid too but have no idea how to do it.

edit: also is there a way to add reply-to option to env file?

The reply-to header is automatically set to the user’s email address.

Thanks for your answer @Hillel. Would it be acceptable for you to make it an option of .env file? The application can read it from the .env file. Advanced users can modify it. Thanks again!

Hey drdrake, I just edited the username in the .env file. However I ran a quick test and it didn’t seem to work, but I just did one test, I’ll have to come back to this later.

Thanks for getting back to me. If you find a wordaround, please tell me. Thanks!

I’ll look into adding the .env option in our next release.

Thank you very much!

It looks like there may already be a .env option. Try setting MAIL_FROM_ADDRESS to the email address and MAIL_USERNAME to the API key.

@hillel Thanks! Will this option be available in the settings panel in invoiceninja in a future version?

Possibly in a future release.