Setting up Mailgun on subdomain

I obviously need help with this one.

I have main domain and subdomain - 2 different websites. There is a default laravel registration form on subdomain.
I need a functional process of email sending to users on a subdomain. Mailgun gives this opportunity. But when I starting to set up all the things I cannot insert MX records:

the same is for DNS Records: NO DOMAIN ON ACCOUNT

Does that mean: I can use mailsend only for domain and NOT for subdomain?
Or it means that I will set up mailsend for domain and subdomain will use it also?

I feel like asking stupid questions, but I can’t figure it out myself.

You can’t set MX records on a subdomain from our panel, that’s true. But that doesn’t mean you cannot send email from your subdomain.

First of all, you don’t need MX records to send email. Mailgun does give you MX records to use, but you only need those if you want to receive email with Mailgun. That’s entirely optional.

So you may still be able to add your subdomain as a sending domain to Mailgun.

And even if you can’t, that doesn’t mean you cannot send email. If you have as a sending domain, and would like to send mail from, you could use [email protected] as your sending email address. So you can skip the subdomain setup entirely.


I don’t get it, what should I do?

I have domain:
I have API Key from Mailgun account

I have also DNS Reocrds and values in Mailgun:

I know that I have to configure mailgun in config/services.php

and there is .env configuration also:


I have to perform these steps, but I got stucked by the first one:

  1. Go to your DNS provider
    Go to the DNS provider that you use to manage and add the following DNS records. Where to add?
  2. Add DNS records for sending
    I have to enter this value: v=spf1 ~all where to enter? .env? services.php? cPanel?
  3. Add DNS records for tracking (I don’t think I need this step)
  4. Wait for domain verification

I watched a step-by-step video, but I didn’t see any similarity what is in video and what is in cPanel of Infinityfree

I’m sorry. I assumed that “subdomain” meant a subdomain of your own domain, not a free subdomain. The instructions only apply if you have your own domain, and want to upload something to a subdomain of your own domain.

The DNS record you need to enter is called an “SPF Record”. There is a section called that in the control panel. But again, that only works if you have your own domain name.


So what are my chances? User will not be able to register, because of the email which will not be sent to verify user’s email?

Well, you still have some options:

  • Try to send the email with PHP mail first. If you’re lucky, it just works. We whitelist specifically verification email templates from popular scripts. So if you use a popular script, you may be able to use PHP mail anyways.
  • Send the mail with a Gmail account or other email service without custom domain. It won’t be quite as professional as using the domain of your website, but at least you can get the message out.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.