Skip to content

Commit

Permalink
Merge pull request #204 from dbarzin/dev
Browse files Browse the repository at this point in the history
Mail
  • Loading branch information
dbarzin authored Oct 21, 2024
2 parents 6d5519d + 73d7dca commit a2eaba4
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 20 deletions.
1 change: 1 addition & 0 deletions .env.ci
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ MAIL_HOST=sandbox.smtp.mailtrap.io
MAIL_PORT=2525
MAIL_AUTH=true
MAIL_SMTP_SECURE='ssl'
MAIL_SMTP_AUTO_TLS=false
MAIL_USERNAME=
MAIL_PASSWORD=

Expand Down
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ SESSION_LIFETIME=120
MAIL_HOST='smtp.localhost'
MAIL_PORT=2525
MAIL_AUTH=true
MAIL_SMTP_SECURE='ssl'
MAIL_SMTP_SECURE='ssl' # 'ssl', 'tls' or null
MAIL_SMTP_AUTO_TLS=false # true / false
MAIL_USERNAME=
MAIL_PASSWORD=

# MAIL_DKIM_DOMAIN = 'admin.local';
# MAIL_DKIM_PRIVATE = '/path/to/private/key';
# MAIL_DKIM_SELECTOR = 'default'; // Match your DKIM DNS selector
# MAIL_DKIM_PASSPHRASE = ''; // Only if your key has a passphrase
# MAIL_DKIM_SELECTOR = 'default'; # Match your DKIM DNS selector
# MAIL_DKIM_PASSPHRASE = ''; # Only if your key has a passphrase
1 change: 1 addition & 0 deletions INSTALL.debian.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ Vous devez configurer l'accès au serveur SMTP dans .env
MAIL_PORT=2525
MAIL_AUTH=true
MAIL_SMTP_SECURE='ssl'
MAIL_SMTP_AUTO_TLS=false
MAIL_USERNAME=
MAIL_PASSWORD=

Expand Down
1 change: 1 addition & 0 deletions INSTALL.debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ You have to configure the SMTP server access in .env
MAIL_PORT=2525
MAIL_AUTH=true
MAIL_SMTP_SECURE='ssl'
MAIL_SMTP_AUTO_TLS=false
MAIL_USERNAME=
MAIL_PASSWORD=

Expand Down
1 change: 1 addition & 0 deletions INSTALL.fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ Vous devez configurer l'accès au serveur SMTP dans .env
MAIL_PORT=2525
MAIL_AUTH=true
MAIL_SMTP_SECURE='ssl'
MAIL_SMTP_AUTO_TLS=false
MAIL_USERNAME=
MAIL_PASSWORD=

Expand Down
1 change: 1 addition & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ You have to configure the SMTP server access in .env
MAIL_PORT=2525
MAIL_AUTH=true
MAIL_SMTP_SECURE='ssl'
MAIL_SMTP_AUTO_TLS=false
MAIL_USERNAME=
MAIL_PASSWORD=

Expand Down
17 changes: 8 additions & 9 deletions app/Console/Commands/SendNotifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@ public function handle()

try {
// Server settings
$mail->isSMTP(); // Use SMTP
$mail->Host = env('MAIL_HOST'); // Set the SMTP server
$mail->SMTPAuth = env('MAIL_AUTH'); // Enable SMTP authentication
$mail->Username = env('MAIL_USERNAME'); // SMTP username
$mail->Password = env('MAIL_PASSWORD'); // SMTP password
$mail->SMTPSecure = env('MAIL_SMTPSECURE',false); // Enable TLS encryption, `ssl` also accepted
if ($mail->SMTPSecure==false)
$mail->SMTPAutoTLS=false;
$mail->Port = env('MAIL_PORT'); // TCP port to connect to
$mail->isSMTP(); // Use SMTP
$mail->Host = env('MAIL_HOST'); // Set the SMTP server
$mail->SMTPAuth = env('MAIL_AUTH'); // Enable SMTP authentication
$mail->Username = env('MAIL_USERNAME'); // SMTP username
$mail->Password = env('MAIL_PASSWORD'); // SMTP password
$mail->SMTPSecure = env('MAIL_SMTP_SECURE',false); // Enable TLS encryption, `ssl` also accepted
$mail->SMTPAutoTLS = env('MAIL_SMTP_AUTO_TLS'); // Enable auto TLS
$mail->Port = env('MAIL_PORT'); // TCP port to connect to

// Loop on all users
$users = User::all();
Expand Down
17 changes: 9 additions & 8 deletions app/Http/Controllers/ConfigurationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,15 @@ public function save(Request $request)
try {
// Server settings
$mail->isSMTP(); // Use SMTP
$mail->Host = env('MAIL_HOST'); // Set the SMTP server
$mail->SMTPAuth = env('MAIL_AUTH'); // Enable SMTP authentication
$mail->Username = env('MAIL_USERNAME'); // SMTP username
$mail->Password = env('MAIL_PASSWORD'); // SMTP password
$mail->SMTPSecure = env('MAIL_SMTPSECURE',false); // Enable TLS encryption, `ssl` also accepted
if ($mail->SMTPSecure==false)
$mail->SMTPAutoTLS=false;
$mail->Port = env('MAIL_PORT'); // TCP port to connect to
// Server settings
$mail->isSMTP(); // Use SMTP
$mail->Host = env('MAIL_HOST'); // Set the SMTP server
$mail->SMTPAuth = env('MAIL_AUTH'); // Enable SMTP authentication
$mail->Username = env('MAIL_USERNAME'); // SMTP username
$mail->Password = env('MAIL_PASSWORD'); // SMTP password
$mail->SMTPSecure = env('MAIL_SMTP_SECURE',false); // Enable TLS encryption, `ssl` also accepted
$mail->SMTPAutoTLS = env('MAIL_SMTP_AUTO_TLS'); // Enable auto TLS
$mail->Port = env('MAIL_PORT'); // TCP port to connect to

// Recipients
$mail->setFrom($mail_from);
Expand Down

0 comments on commit a2eaba4

Please sign in to comment.