
After explaining how to set up Gmail with a custom domain, we continue our series of articles about the tool with one of its most common use cases: setting up an automatic reply.
Reasons to set the Out of Office status in Gmail
Pretty much all of us have needed to set up an automatic reply for our emails at some point.
Generally, there are two reasons:
- Holidays: in which case we will schedule the automatic reply so it is temporary.
- Changing jobs or email accounts: if that is the case, we will not need to schedule an end date for sending automatic replies.
So, given that it is July when this article is being published, there is a good chance we will need to do it soon, so I am going to explain the steps.
How to set up an automatic reply in Gmail
Before we start, you need to know that there are three cases:
- If the account is a Gmail account (it is an “@gmail.com”, “@gmail.es” or similar) it is easy to do.
- If the account is an email with a custom domain (“info@midominio.com”) linked to Gmail two things can happen:
- Our mail server may offer the option to create automatic replies, in which case it will be simple and similar to Gmail.
- The server may not offer that option, which makes things a little —or a lot, depending— more complicated.
Right, let's start with the first option.
Case 1: how to set up an automatic message in a Gmail account
This is the case where your email account is micuenta@gmail.com or similar. No custom domain involved.
Everything is done from the Gmail platform in just 5 steps:
#1. Sign in to your Gmail account
Open your PC browser and sign in to your Gmail account with your username and password.
Just as you always do.
#2. Go to Settings
Then click “See all settings”:

#3. Scroll down to the Automatic reply section
It is in the “General” tab (the one that opened when you clicked “See all settings”), right at the bottom:

#4. Configure the automatic reply
Here you will need to:
- Turn on the automatic reply.
- Choose the start and end date.
- Write the subject and the automatic message.

#5. Save the changes
All you have to do is save the changes using the button at the bottom:

Done. We have finished the first case. Easy, right? Now let's move on to the next ones.
Case 2: How to set up an automatic message on my mail server
This second case is for email accounts with a custom domain (nombre@midominio.com), whether or not the custom-domain account is linked to Gmail.
Also, you need to know that not all servers offer this option, although the most common web hosting providers generally do.
That said, if the hosting offers the option, it is usually quite similar to setting up Gmail's automatic reply.
In my case, I use WebEmpresa, so the screenshots are from that hosting provider, but if you use another one, the process is similar.
Let's look at the 4 steps in this process:
#1. Go to your control panel
Open the control panel for the hosting plan you use. Many use fairly standard systems such as Plesk or Cpanel, similar to the one we are going to see.
If you do not remember the access password, request it and log in once you have it. You will see something like this:

#2. Find and open the webmail settings
In my hosting provider, inside the webmail section, you can see a direct link to create the autoresponder:

Click and open it.
#3. Configure the autoresponder
Here you have a few more options than in Gmail:
- Choose the name.
- Select the email account.
- Write the subject.
- Turn on the automatic reply or choose the start and end date.
- Write the automatic message.

#4. Save the changes
Now all that is left is to save the changes using the button:

Done.
As I was saying, this option works for any email account with a custom domain, whether or not it is linked to Gmail. In both cases, this is how you set up the automatic reply.
Case 3: how to set up an automatic message if the server does not offer this option
I mentioned that most commercial hosting providers let us create an automatic reply for custom-domain email accounts. But some mail servers do not (for example Postfix). So, what can we do?
The first thing would be to link the custom email account to a Gmail account.
Once you have done that, this is where the magic starts.
I explain it in the video or in text below:
#1. Sign in to your Gmail account
The one where you want to set up the autoresponder. This detail matters.
#2. Go to the Google Scripts section
What?
Had you never heard of this section?
Don't worry, there is a first time for everything.
Go to https://script.google.com.
If you completed step 1, you will have entered here while signed in with the correct Gmail account.

#3. Create a new script
All you have to do is click here and give it the name you want. In my case it will be “AUTORRESPONDER 2” (yes, there was a failed attempt before this one).

Copy and paste the code I give you like this:

Here is the code:
function RespondEmail(e) {
// Escribe el texto de respuesta
var responsebody = "Estaré fuera de la oficina hasta el 7 de julio";
//Tu cuenta de autorespuesta
var threads = GmailApp.search("to:(yago@yopongoelhielo.com) label:unread");
for (var i = 0; i < threads.length; i++) {
threads[i].reply("", {htmlBody: responsebody, from: "yago@yopongoelhielo.com"});}
// Marca los emails como leídos
var threads = GmailApp.search("to:(yago@yopongoelhielo.com) label:unread");
GmailApp.markThreadsRead(threads);
}
Important: change the account you see there to yours. Remember that it has to be linked to Gmail or it will not work.
Save from here:

#4. Create the trigger
Go to the Triggers section using this icon and click “Create a new trigger”:

Configure it like this:

These are the settings:
- Choose which function to run: RespondEmail (this is the name of the function we created).
- Choose which deployment should run: Head.
- Select event source: Time-driven.
- Select type of time based trigger: Minutes timer.
- Select minute interval: Every minute.
Important:
Before saving, you need to know what this trigger will do, which is the following:
- Every minute it will check your account to see whether there are unread emails in the inbox.
- For every unread email it finds, it will send a reply email from our account using the message we put in the script.
- From the very moment you save the trigger.
So check everything carefully before saving, because there is no going back afterwards (you can only pause it or delete the trigger, but you cannot delete emails it has already replied to).
Check it again to make sure.
Once you have checked everything twice, save it.
Your automatic reply is now set up.
Disadvantage
Right, perhaps you have not fully noticed what this script does.
That's normal, it happened to me the first time (I already mentioned that there was a previous script attempt).
This script replies to every unread message in the inbox as soon as you save the trigger.
This means that it will not only reply to new ones arriving after you save it, but also, if you have old unanswered messages, the script will reply to those too.
Even if they are from 5 years ago. It will reply to them.
And that is an important drawback for some people.
Because if you are like me and keep quite a few old unread messages in the inbox, this solution will only work for you to a point.
If, on the other hand, you open every email that reaches your inbox (not the Social tab, not Promotions, only the inbox) or store unread emails in different folders or tabs, then this solution is perfect for you because it will do what you expect:
Reply to messages that remain unread in the inbox while you are out of the office.
Despite this disadvantage, I think being able to set up an autoresponder on an account managed by a server that does not support one more than makes up for it, and it is another example of why linking custom-domain accounts to Gmail matters.
What's more, the script could keep being developed from this base to fine-tune its behaviour completely.
I'll leave that part to you.
Test the automatic reply
Right, all the work we have done is pointless if we do not test that what we set up works correctly.
To do that, all you need to do is turn it on (even if only briefly) and send ourselves an email from another account to the address where we are creating the automatic reply.
If doing this makes an email with the message we programmed arrive, we can consider the setup correct and leave it enabled, or disable it if it is not yet time to start using it and enable it when the time comes.
That way we can relax, go on holiday and disconnect from email as much as we want, which is no small thing.
Automatic message format
Finally, I do not want to end the article without briefly mentioning what I think an Out of Office message should look like.
In my view, these replies should explain three things:
- That you are out of the office without access to email or with limited access.
- The dates during which your availability will be reduced.
- And the solution in case of an emergency: whether that is another email account, a phone number or WhatsApp, or the person who will be your backup during this period.
In short, something like:
Hi,
From July 15 to 25 I will be out of the office with limited access to email, so I will reply when I return.
If it is urgent, you can contact Pablo (pablo@mibackup.com) or email me at this address: miemailpersonal@nomedesporsaco.com.
Best regards.
That's my view. Obviously, you can put whatever you like here.
And now, yes, we're done.
Final conclusions
It is clear that sending an automatic message when we are out of the office is good practice: you let the person know that you have not read the email, so they cannot expect an immediate response. You also give them information to solve the issue if it is urgent.
It is true that with Gmail accounts, or with hosting providers that host our custom domains and support this feature, it is very simple.
Things become more complicated when our server does not directly offer the option to create an autoresponder.
Then we will have to rely on Gmail, its flexibility and its large developer community to build our own.
Although the one I have shown you here is not perfect (with the drawback mentioned of having all inbox emails opened), it is still better than having no option at all.
That wraps up the second article dedicated to Gmail, and we are digging a little deeper into the ins and outs of the tool.
Soon we will see what to do if those 15GB of storage are not enough for you. It sounds crazy, but it is quite possible depending on how you use Google Drive.
Believe me.


Leave a Reply