How to change magento2.3 email id for send mail
In Magento 2.3, you can change the email ID used for sending emails by modifying the transport
section in the admin/email/config.php
file.
Here are the steps:
- Log in to your Magento 2.3 admin panel.
- Go to Stores > Configuration > Advanced > System.
- Scroll down to the Email section and click on Edit.
- In the Email section, click on the Transport tab.
- In the Transport tab, you will see a list of available email transport options. Click on the Edit button next to the Default option.
- In the Default email transport configuration, you will see a section called Options. In this section, you can specify the email ID used for sending emails.
- To change the email ID, click on the Edit button next to the From Email field and enter the new email ID.
- Click Save to save the changes.
Alternatively, you can also change the email ID by modifying the transport
section in the app/etc/env.php
file.
Here's an example of how to modify the transport
section in the env.php
file:
'transport' => [
'default' => [
'transport_type' => 'smtp',
'host' => 'your_smtp_host',
'port' => 'your_smtp_port',
'username' => 'your_smtp_username',
'password' => 'your_smtp_password',
'from_email' => '[email protected]', // Change this to the new email ID
'from_name' => 'Your Name',
],
],
Make sure to replace your_smtp_host
, your_smtp_port
, your_smtp_username
, and your_smtp_password
with your actual SMTP server settings.
After modifying the env.php
file, you need to run the following command to apply the changes:
php bin/magento setup:upgrade
This will update the Magento configuration and apply the changes to the email transport settings.
Note that you may need to restart your Magento server or run the following command to refresh the email transport settings:
php bin/magento cache:flush
After making these changes, Magento should use the new email ID for sending emails.