mirror of
https://github.com/projectsend/projectsend.git
synced 2026-09-17 09:05:08 +00:00
6e47d76ba6
Client file sharing, rebuilt from the ground up: a private area per client, resumable uploads, folders, groups and categories, sharing with expiry dates and download limits, comments, file versions, an activity log, a REST API, and sixteen languages. This repository begins here. ProjectSend 2 was developed privately, and that development history is not published — the previous generation remains available, with its own history, at projectsend/legacy. Free software under the GNU General Public License v2, or (at your option) any later version.
51 lines
1.4 KiB
PHP
51 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Modules\Platform\Settings;
|
|
|
|
/**
|
|
* A preset picker over the single generic SMTP transport — every provider
|
|
* here supports SMTP relay, so selecting one just pre-fills the well-known
|
|
* host/port; the app always sends via Laravel's "smtp" mailer regardless
|
|
* of which preset was picked. Custom covers anything else ("etc").
|
|
*/
|
|
enum MailProvider: string
|
|
{
|
|
case Custom = 'custom';
|
|
case SendGrid = 'sendgrid';
|
|
case Mailgun = 'mailgun';
|
|
case Postmark = 'postmark';
|
|
case AmazonSes = 'ses';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::Custom => 'Custom SMTP',
|
|
self::SendGrid => 'SendGrid',
|
|
self::Mailgun => 'Mailgun',
|
|
self::Postmark => 'Postmark',
|
|
self::AmazonSes => 'Amazon SES',
|
|
};
|
|
}
|
|
|
|
public function defaultHost(): ?string
|
|
{
|
|
return match ($this) {
|
|
self::Custom => null,
|
|
self::SendGrid => 'smtp.sendgrid.net',
|
|
self::Mailgun => 'smtp.mailgun.org',
|
|
self::Postmark => 'smtp.postmarkapp.com',
|
|
self::AmazonSes => 'email-smtp.us-east-1.amazonaws.com',
|
|
};
|
|
}
|
|
|
|
public function defaultPort(): ?int
|
|
{
|
|
return match ($this) {
|
|
self::Custom => null,
|
|
self::SendGrid, self::Mailgun, self::Postmark, self::AmazonSes => 587,
|
|
};
|
|
}
|
|
}
|