You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Microsoft recently tightened security and soon will prevent SMTP authentication from other applications.
Instead they require the registration of a App and sendmail and sending via a Office 365 mailbox will then only be possible if the user/mailbox has been authenticated against the App configuration.
changed the title [-]Feature Request - Add option to authenticate SMTP connection using OAuth[/-][+][Feature Request] Add option to authenticate SMTP connection using OAuth[/+]on Jul 22, 2023
Hey @nvizion InvoicePlane v2 is actively developed at the moment.
If you want to help, come join the Discord channel here: https://discord.gg/PPzD2hTrXt
Story: As a company admin whose email provider (Microsoft 365, Google) requires OAuth 2.0 for SMTP, I want InvoicePlane v2 to support SMTP OAuth authentication so that I can send invoice emails without relying on deprecated Basic Auth or app passwords.
v2 context: v2 uses Laravel's Mail with Symfony Mailer. Symfony Mailer supports OAuth2 via league/oauth2-client adapters. The Settings → Email Configuration page needs to expose OAuth2 credential fields alongside the existing SMTP settings.
Acceptance Criteria:
Email Settings has an Authentication Type toggle: Password (existing) / OAuth2 (Microsoft 365) / OAuth2 (Google).
// Mail fails gracefully when OAuth token expired and cannot refresh/* Arrange */$this->company->settings()->update(['smtp_oauth_refresh_token' => 'expired_token']);
Http::fake(['*/oauth2/token' => Http::response(['error' => 'invalid_grant'], 400)]);
/* Act */$result = app(MailService::class)->sendInvoiceEmail($invoice = Invoice::factory()->for($this->company)->create());
/* Assert */$this->assertFalse($result);
// And a notification is queued for the admin
changed the title [-][Feature Request] Add option to authenticate SMTP connection using OAuth[/-][+][Core]: SMTP OAuth authentication (Microsoft 365 / Google)[/+]on Jun 13, 2026
Added to support future implementation of this request. The issue body is unchanged.
config/mail.php's smtp mailer only supports classic username/password auth (env('MAIL_USERNAME'), env('MAIL_PASSWORD')) — there is no OAuth token transport configured, and composer.json has no Microsoft Graph or Google API OAuth package installed. Modules\Core\Models\MailQueue (table mail_queue) already tracks is_sent/error per mailable, which is useful scaffolding for asserting OAuth-specific send failures once a token-based transport exists, but the transport itself is entirely new work — this is not a config tweak, it needs a custom Symfony Mailer transport (or a package like league/oauth2-client + a custom transport class) plus token storage/refresh.
PHPUnit:it_has_no_oauth_mail_transport_configured_today() (documents current state)
Edge cases worth covering: token refresh failing mid-send (should not silently drop the email — needs a retry or clear error surfaced to the admin), and per-company OAuth credentials since this is a multi-tenant app (each Company may need its own Microsoft/Google app registration, not one global credential).
Activity
nielsdrost7 commentedon Apr 20, 2023
It is very difficult to do that in v1
Would you mind if we do it in version 2?
nvizion commentedon Apr 20, 2023
nielsdrost7 commentedon Apr 20, 2023
Sorry, I had to translate it, plus cut the extra info that was there
nielsdrost7 commentedon Apr 20, 2023
So ... V2. No planning yet.
The idea is to build it with the help of the community.
[-]Feature Request - Add option to authenticate SMTP connection using OAuth[/-][+][Feature Request] Add option to authenticate SMTP connection using OAuth[/+]nielsdrost7 commentedon Jan 19, 2026
Hey @nvizion InvoicePlane v2 is actively developed at the moment.
If you want to help, come join the Discord channel here: https://discord.gg/PPzD2hTrXt
nielsdrost7 commentedon Jun 13, 2026
Planning Note — v2 Implementation
Story: As a company admin whose email provider (Microsoft 365, Google) requires OAuth 2.0 for SMTP, I want InvoicePlane v2 to support SMTP OAuth authentication so that I can send invoice emails without relying on deprecated Basic Auth or app passwords.
v2 context: v2 uses Laravel's Mail with Symfony Mailer. Symfony Mailer supports OAuth2 via
league/oauth2-clientadapters. The Settings → Email Configuration page needs to expose OAuth2 credential fields alongside the existing SMTP settings.Acceptance Criteria:
Password(existing) /OAuth2 (Microsoft 365)/OAuth2 (Google).Implementation:
league/oauth2-client+thenetworg/oauth2-azure(for Microsoft) orleague/oauth2-google.MailService::getMailer(Company): build aSmtpTransportwithOauthTokenProviderwhen auth type isoauth2_microsoftoroauth2_google.$company->settings->set('smtp_oauth_refresh_token', encrypt($token)).GET /oauth/email/callback— outside Filament, in a dedicated controller.Test Scenarios (PHPUnit):
Generated by Claude Code
[-][Feature Request] Add option to authenticate SMTP connection using OAuth[/-][+][Core]: SMTP OAuth authentication (Microsoft 365 / Google)[/+]nielsdrost7 commentedon Jul 16, 2026
Test Suggestions
Added to support future implementation of this request. The issue body is unchanged.
config/mail.php'ssmtpmailer only supports classicusername/passwordauth (env('MAIL_USERNAME'),env('MAIL_PASSWORD')) — there is no OAuth token transport configured, andcomposer.jsonhas no Microsoft Graph or Google API OAuth package installed.Modules\Core\Models\MailQueue(tablemail_queue) already tracksis_sent/errorper mailable, which is useful scaffolding for asserting OAuth-specific send failures once a token-based transport exists, but the transport itself is entirely new work — this is not a config tweak, it needs a custom Symfony Mailer transport (or a package likeleague/oauth2-client+ a custom transport class) plus token storage/refresh.it_has_no_oauth_mail_transport_configured_today()(documents current state)it_refreshes_an_expired_oauth_token_before_sending()(aspirational)it_records_a_mail_queue_failure_when_the_oauth_token_is_invalid()Edge cases worth covering: token refresh failing mid-send (should not silently drop the email — needs a retry or clear error surfaced to the admin), and per-company OAuth credentials since this is a multi-tenant app (each
Companymay need its own Microsoft/Google app registration, not one global credential).