Email sending settings
Make settings for sending emails from Exment.
In addition, the procedure for sending a test email after setting is also described.
※Email sending functions such as "Email does not arrive" and "Email is classified as junk email" are not subject to inquiries because they depend largely on each server and environment.
Overview
Exment may send emails from the system.
Example:- Data update notification
- Two-step certification
In order to send mail, you need to make SMTP settings.
This section describes the setting procedure for sending an email.There are two ways to set up email transmission.
Set from screen (default): Set the mail sending settings by entering the SMTP settings on the system setting screen. It can be used when sending an email with a simple SMTP setting.
Set in config file or env file: When setting mail by a method other than SMTP such as Amazon SES, edit the setting file on the server or use composer to make the setting. ※For advanced users.
Setting method-Set from the screen
The system administrator accesses the system setting screen.
Enter the following settings.

When the host name is entered and saved, Exment sends mail by SMTP, using the settings on the screen.
Mail is sent by SMTP even if "MAIL_MAILER" in ".env" is still "log", the initial value of Laravel (which writes the mail to the log instead of sending it).
※If "MAIL_MAILER" in ".env" is set to something other than "log" (sendmail, ses, and so on), that sending method is used.
※If "EXMENT_MAIL_SETTING_ENV_FORCE=true" is set in ".env", the settings on the screen are not used. See Set in config file or env file.
※SMTP setting example (for Xserver): here
※SMTP setting example (for Sakura Internet): here
Setting method-Set with config file or env file
- Open the .env file and enter the following settings.
EXMENT_MAIL_SETTING_ENV_FORCE=trueOriginally, in Laravel, the setting value of ".env" file is used as a parameter of mail transmission, but from v1.3.6, the setting value of ".env" file is not used and the screen The value registered in "System Settings" of is now used.
However, in some cases you may want to continue setting up the ".env" file.
Especially with Laravel, you can also send emails using a sending method other than SMTP.
In that case, by making this setting, the setting value entered in the ".env" file will continue to be used.
After that, please set various Laravel mail sending drivers.
It is also recommended to enter the following settings in .env.
MAIL_FROM_ADDRESS = (source address)
MAIL_FROM_NAME = (name displayed to the sender)SPF record settings
- If the sent mail becomes junk mail, it is often due to the setting of "SPF record" of the domain. Register your SPF record in your domain settings.
[Reference 1] (https://sendgrid.kke.co.jp/blog/?p=3509)
[Reference 2] (https://salt.iajapan.org/wpmu/anti_spam/admin/operation/information/spf_i01/)
Send test email
- You can use the above email sending settings to send a test email.
You can execute it from the screen or from a command.
Run from screen
The system administrator accesses the system setting screen.
In the "Send test email" item, enter the email destination and click [Send test email].

※For convenience of processing, it is necessary to save "System Mail Settings" at the top of the page.
Please save it once and then send the test email.
Execute from command
- Enter the following command in the root folder of your project.
php artisan exment:notifytest --to=(mail destination)In case of transmission error
- The error log will be output to the path "storage / logs / laravel.log", so please check it.
