Send Mail In WordPress With Mailgun Service & Plugin
Recently I received many questions from our theme users that their WordPress website can’t send mail to visitors. Generally, I told them to make sure the PHP sendmail module is working properly on their server, however, after they installed the sendmail module and checked again, they had another problem that the sending speed is very slow and asked me how to fix it, it’s a server configuration issue, although I know a solution is that update the “/etc/hosts” file on your server with “nano /etc/hosts” command to like this: 127.0.0.1 localhost.localdomain localhost yourhostname, but I just strongly recommend to use Mailgun SMTP service to instead of PHP sendmail, because of high stability.
Sign Up With Mailgun Service
Mailgun provides a powerful and easily use service, the free plan is awesome but you can only send 10000 emails in a month, even so, it’s enough for the personal and small business, and you can upgrade to the other plan at any time. Well, let’s go.
Visit Mailgun website, click the sign up button and complete your account details.
OK, click Create Account button, then go to your email and check the activation link to verify your account.
When you go to “domains” page, you will see the sandbox that you can use it directly without add new domain.
Click the sanboxb966350a…. link to see the test domain details like below
Don’t close this page, and go to your WordPress Dashboard now.
Install Mailgun Plugin
Login your WordPress Dashboard and go to “Plugins > Add New”, search “mailgun”, find the “Mailgun for WordPress” plugin by Mailgun like below, install and activate it.
Now let’s go to “Setting > Mailgun” page, just copy the domain and api values from the domain information page, complete the fields as below.
That’s it! After you save changes, you can click test configuration button, it will send a test mail to the WordPress administrator email.
Add Own Domain (Optional)
Back to your Mailgun domains page, click “Add New Domain” button, enter your own domain
For example, if your domain name was registered at godaddy, then go to your godaddy account to manage your domain DNS records. After you finished it, back to this page and click “continue” button, it will lead you to the final page as below.
After a while, you could click “Check DNS Record now” button to know whether the new DNS records are valid or not. When they are valid, your own domain will actived, just enjoy it!