SMTP Setup

I am having issues getting this to work with gmail or hotmail, they each just shoot off ‘security warnings’ and disable my account. I did see some of the instructions for enabling less secure apps but I didn’t know if there was a way to use sendmail php to basically be its own SMTP server and kind of spoof email addresses.

Let me know the best way to set this up because there will eventually be multiple clients that will need this configured for.

Thanks

The SMTP settings are currently set at the app level, we don’t support per-client mail settings.

We used to set the from address as our user’s email but found they were more likely to bounce. We now set maildelivery@ as the from address and the user’s email as the reply-to.

We recommend using https://postmarkapp.com/ as we support their email open and bounce tracking APIs.

Thanks. So to be clear each client in a multi tenant environment will not be able to have email coming their company address, because we are only able to configure 1 global SMTP setting?

Also just so I am clear you are recommending something like maildelivery@mydomain.com as the from but what goes in the reply to address as there could be many users and clients on the system?

I will check out postmarkapp and see what those settings look like.

Correct.

The reply to is set automatically by the app to the user’s email address.

Is there a way to add SMTP authentication? I just setup Amazon SES but there are not enough fields on the GUI to add username/password. Can we add via the .env file?

Here are the example settings for a mail client: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/configure-email-client.html

You should be able to configure the SMTP settings in the .env file

Hi

I too am having issue with Self install 2.5.1.3 sending a mail. I initially tried a git clone but am currently running against the released zip. I have undertaken a composer update and install.

The server successfully sends emails through a 1&1 SMPT account. The exact same settings are added to .env. Our server is Windows 2008r2. I have fake sendmail configured too and this seems to work with other PHP applications.

I have tried all 3 available options, smtp, mail and sendmail but no email appears to be sent. I can not see anything in the laravel, apache or php logs either. In all, I dont have any idea what I need to do to resolve this. Any pointers? Any other logs that may have any further info? Any way to increase the logging?

You could try adding some debug code such as dd($response); in app/Ninja/Mailers/Mailer.php

@Hillel Coren: Hi. Thanks very much for the pointer. I had some issues with the dd, but writing directly to error_log I discovered that the issues was to do with the SSL certificate. We are running invoice ninja on a https://invoices.[ourdomain].com but the SSL certificate is for the www.[ourdomain].com

This gave:
error: Unable to open file for reading [https://invoice.[ourdomain].com/images/invoiceninja-logo.png]
and then the social ones such as:
error: Unable to open file for reading [https://invoice.[ourdomain].com/images/emails/icon-facebook.png]

Turning to the code:
…\resources\views\emails\master_user.blade.php Line 12:

<img src="{{ $message->embed(asset('images/invoiceninja-logo.png')) }}" alt="github" />

I dont know how to correct this so that the URL used for the asset is either not ssl or how to change the url to a https url that is backed by a valid SSL certificate. Any ideas?

Also, the alt looks like it should say invoicenija :slight_smile:

Thanks again.

You can either purchase a HTTPS cert for the invoices subdomain or setup the site as [yourdomain].com/invoices.

Hello,

I would also need explanations on how to setup the SMTP credentials to use with Amazon SES. Is it even possible?

It would save the hassle of having to configure postfix or sendmail to work with SES and then configure invoiceninja to send via sendmail…

Thanks in advance

From the Laravel docs it looks like using Amazon SES requires adding the Amazon AWS SDK for PHP.

https://laravel.com/docs/master/mail

Amazon SES still not supported?

It should work, follow the steps under ‘SES Driver’ here: https://laravel.com/docs/master/mail

I apologize in advance for the thread necromancy…

I’ve followed the steps outlined by the laravel documentation, but the invoiceninja setup page still declines connection to the ses endpoint in my region.

Is there a known-good example configuration to refer to?

Thank you,

What error are you seeing?

Failed to authenticate on SMTP server with username “app.dev.invoiceninja” using 2 possible authenticators

Username is accurate for the environment we’re working in. Don’t know where I can get more detailed info given the error logs.

Maybe this will help…

http://stackoverflow.com/a/20656870
http://stackoverflow.com/a/35056956

Well played. :slight_smile: . Noted those while I was waiting on your reply. Thank you.

When I get this sorted, I’ll post a guide back to you all if you give me a way to reach you.