Configuring Mailgun SMTP Relay for Multiple Domains on a Single CyberPanel Installation
In this article, we will discuss the process of configuring Mailgun SMTP relay for multiple domains on a single CyberPanel installation. This setup can be particularly useful for those who want to manage multiple domains and their email services from a single interface. By the end of this article, you should have a clear understanding of the key concepts, applications, and significance of this setup.
Prerequisites
Before we begin, it is assumed that you have already installed CyberPanel on your server and have access to a Mailgun account. If you haven't already done so, you can download CyberPanel from the official website and sign up for a Mailgun account on the Mailgun website.
Adding Domains to CyberPanel
The first step in setting up Mailgun SMTP relay for multiple domains on a single CyberPanel installation is to add the domains to CyberPanel. To do this, log in to CyberPanel and navigate to the Domains section. From here, you can add new domains by clicking on the Create New Domain button and following the on-screen instructions.
Configuring Mailgun
Once you have added the domains to CyberPanel, the next step is to configure Mailgun. To do this, log in to your Mailgun account and navigate to the Domains section. From here, you can add the domains that you want to use with Mailgun by clicking on the Add Domain button and following the on-screen instructions.
After you have added the domains to Mailgun, you will be provided with a set of SMTP credentials that you can use to relay email for those domains. Make a note of these credentials, as you will need them later.
Configuring CyberPanel to Use Mailgun
Now that you have added the domains to CyberPanel and configured Mailgun, the next step is to configure CyberPanel to use Mailgun for email relay. To do this, log in to CyberPanel and navigate to the Email section. From here, click on the Change Settings button and select Remote Mail Exchanger from the drop-down menu.
On the next screen, enter the SMTP credentials that you obtained from Mailgun in the previous step. Once you have entered the credentials, click on the Save button to save the changes.
Testing the Setup
To ensure that everything is working correctly, it is a good idea to test the setup by sending a test email. To do this, log in to CyberPanel and navigate to the Email section. From here, click on the Create New Email button and enter the relevant details for the email account that you want to test.
Once you have created the email account, you can send a test email by clicking on the Compose button and entering the recipient's email address. From here, click on the Send button to send the email. If everything is working correctly, the email should be delivered to the recipient's inbox.
Significance and Applications
Configuring Mailgun SMTP relay for multiple domains on a single CyberPanel installation can be particularly useful for those who want to manage multiple domains and their email services from a single interface. This setup can help to simplify email management, reduce the amount of time and effort required to manage multiple domains, and improve the overall efficiency of email services.
- In this article, we discussed the process of configuring Mailgun SMTP relay for multiple domains on a single CyberPanel installation.
- We covered the prerequisites for this setup, including installing CyberPanel and signing up for a Mailgun account.
- We discussed the process of adding domains to CyberPanel and configuring Mailgun for those domains.
- We also covered the process of configuring CyberPanel to use Mailgun for email relay and testing the setup.
- Finally, we discussed the significance and applications of this setup, including the potential to simplify email management and improve the overall efficiency of email services.
References
// Example code block
// Set up SMTP credentials
$smtp_host = 'smtp.mailgun.org';
$smtp_port = 587;
$smtp_username = '[email protected]';
$smtp_password = 'your-api-key';
// Create a new email account
$email = new EmailAccount();
$email->name = 'Test User';
$email->email = '[email protected]';
$email->password = 'testpassword';
$email->quota = 1024;
$email->remote_mail_exchanger = true;
$email->smtp_host = $smtp_host;
$email->smtp_port = $smtp_port;
$email->smtp_username = $smtp_username;
$email->smtp_password = $smtp_password;
$email->save();