How Can I Add MX Record for External Mail Server on Vercel?

I am considering using an external mail server for the mail form function in an application hosted on Vercel. I need to add an MX record to Vercel, but I cannot find the setting item. How can I add an MX record?

Additionally, I have considered using the Vercel CLI to add the MX record, but I encountered the error “Error: You don’t have permissions to add records to domain.” How can I resolve this error?

Thank you for your assistance.

Best regards,

Hi and welcome to the community, @si1ver1ining!

Have you tried following this guide?

Regarding the error You don’t have permissions to add records to domain, make sure you have the necessary permissions set up. See relevant documentation:

Hi everyone,

Thank you for your responses.

I understand that with the hobby plan, it is not possible to add MX records to Vercel. It also seems that the issue with the Vercel CLI was due to lack of permissions associated with the hobby plan.

Additionally, I realized that my initial question was not accurate. I have since found a different solution to my problem. I appreciate your help and understanding.

Best regards,

1 Like

Hi @si1ver1ining. I’m glad you found a solution. If you wouldn’t mind sharing the solution here, I’m sure it could help someone else in the future.

I also wanted to let you know that it is possible to add MX records on all plans if the custom domain uses Vercel nameservers. Hobby is not excluded from that. If you can tell me where you heard otherwise, I’d love to get the source corrected. :slightly_smiling_face:

The CLI error you reported sounds like a login or team context issue. If you have multiple accounts, make sure you’ve used vercel login to log in with the right account and vercel switch to switch to the right team context. That should let you use the vercel dns command to manage DNS records for your custom domain. Alternatively, you can manage records from the dashboard GUI which most people find a bit easier.

Thank you for your response.

What I was trying to achieve was to enable the use of a mail form function from a web application hosted on Vercel. Since Vercel does not have a mail server, it is necessary to use an external mail server. Initially, I thought it was necessary to add MX records as mentioned in my first question. However, as I worked towards solving the problem, I realized that it was not necessary.

The solution is as follows:

◆ External Mail Server

  • Prepare a mail account
  • Confirm SMTP settings

◆ Vercel

  • Set up mail settings in Environment Variables
  • Build nodemailer

I have not yet implemented the above steps, but I believe that this procedure will successfully set up the mail settings. If I encounter any issues with the mail settings, I may reply again.

By the way, I understand that it is possible to add MX records on all plans, including the Hobby plan, on Vercel. Also, I understand that the CLI error can be resolved by following the instructions you provided. I will try these steps when necessary.

Thank you very much for your kind response. Best regards.

2 Likes

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