How to send email from Excel

How to send email from excel based on cell value

Send email from excel will be really easy if you will read this post.

This post will give you a simple illustration of how to use the attached excel sheet to send emails or, if you need it, how to use the source code inside it in other excel files. I suggest to start from the base and modified it according to your needs.

Send email from excel : MACRO

The macro provides the following functions:

  • Reading data from excel
  • formatting body email
  • set recipients
  • set up CC
  • attach files
  • send the email
  • update sending data

excel sheet used to send email

Before to proceed it’s important to understand the meaning of the light blue arrow.

What does the LIGHT BLUE ARROW BELOW “SENT ON” mean?

It represents the range that the VBA macro automatically detects in order to process the email.

Your bulk email process can be handled by this short macro very useful and easy to manage (it’s easily implemented even by those who do not know much excel).

The excel sheet contains the information required by the macro refers (the code refers to the columns and not to the header) and a glance is sufficient to understand which kind of data we have available.

A delay has been inserted between sending an email to the other to avoid being blocked by the provider or, worse still, classified as spammers.

In case you want to add more data, add the columns always after the last provided in the

This code has been tested in Excel 10 and Excel 2016 with outlook.

It’s is easily adaptable in other contexts and soon I will also provide other versions for different scenarios.


First of all, take in account that the macro gets the first empty cell of the column H (8) and the first empty cell of column A (1) and uses these boundaries to instance the reading loop ( for .. to ..).

The column H (8) it’s very important because it’s used to store the email’s sent date  (the VBA code automatically populate this cell according to the elaborated row).

In this case, the loop while elaborate the row from 2 to 11.


Even if is really intuitive let me give a brief synthesis of the columns.

  • Column A: Here you must to set the destination email (TO) and it’s a mandatory field.
  • Column B: Here you must to set presentation name used in the opening of the email (e.g. “Dear MAX “) and it’s a mandatory field.
  • Column C: It contains the email’s subject and it’s a mandatory field.
  • Column D: You can specify the signature to use at the end of the email (e.g. “Cheers “)  and it’s a mandatory field.
  • In column E  there is a value that can be used in the body of the email. In this example is a mandatory field, but it can update according to your needs.
  • Column F: Here you have to set the carbon copy destination of the email (CC)  and it’s an optional field.
  • The column G It’s used to get the attachment file (Attachment) and it’s an optional field.

Anyway, the code can easily update in order to change the body, subject and so on.


Vba macro used to send email via excel

In the end the core is :

  • Set OutlookApp = CreateObject(“Outlook.Application”)
  • Set Mess = OutlookApp.CreateItem(olMailItem)
  • With Mess
  • .Subject = Subj
  • .Body = Msg
  • .Recipients.Add (Email)
  • .CC = CC
  • .Attachments.Add (Attach)
  • .Send


Here you can Download the excel file (it’s an xlsm ) : Email_send_blog 2018  servermx.offers servermx.features

How to set email web client with your domain name.

CNAME Records

it’s useful for instance, to rename a webmail client in case of your email being managed by an external provider.

CNAME stand for canonical nome a “CNAME stands for Canonical Name. CNAME records can be used to alias one name to another.”

It’s like a nickname … your name is Elizabeth but someone calls you Betty and when you hear one of two you respond…but what is more is that Betty will appear as to be your native name.

cname logo



If you own your domain and entrust your email service to an external provider, it ‘s really probably that you will read the email via the client proposed by your provider that will use it’s own

This it’s not always appreciated especially from who, owning its domain, feel stronger inside the need to show it’s brand and mark its visibility.

So here we are to show how it’s easily renaming external email provider email client (Roundcube, SquirrelMail, Rainloop etc) and let it appear as is was yours.

A CNAME record on your DNS setup, basically allows that a link like: being turned into (or whatever you need).

In your DNS panel you’ll find several records :
MX (to point the email server provider)
A (to set web entry)
and you can also configure one, or more, CNAME records.

This example, you can find more details here, it’s based a servermx’ Roundcube client.

A servermx’ customer can access to its mail in several ways: one of this is the Roundcube client at

If the customer domain, for instance, being he must to:

MX cpanel setup

MX cpanel setup

That’s all
Now will point the Roundcube client of the external email provider, but the link showed to the email user will be and your custom Webmail URL will be set up.

How configure WordPress email account with Servermx

How do I can set up WordPress MX record? 2108

If you bought a domain via WordPress you will manage your domain configuration (DNS setup) using WordPress panel.

In case you want to use (or anything else email provider) as your email provider what you have to do can be summarized in 4 step :

  • Log into your WordPress admin page
  • Log to WordPress DNS panel.
  • Change/Add MX record .
  • Add the TXT verification record (this step is required by servermx  but even by many other providers)
  • Log into your WordPress admin page :


Log into  WordPress DNS panel

Change/Add MX record.

  1. ADD (if there are no other previous MX records listed)
    1. Find Add New DNS Record button and select it.
    2. Select MX from the drop-down.
    3. In the Hostname text box, provide (replace with your domain name).
    4. In the handled by, set, and provide the priority number as 10. Click Add
    5. Repeat the steps A-D with the values and priority 20. 
  2. CHANGE (if there are other previous MX records listed)
    1. Find Add New DNS Record button and select it.
    2. Locate the current MX record
    3. Delete the current MX Record
    4. Follow the instructions set for the ADD action above mentioned.
  3. Add the TXT verification record
    1. Find Add New DNS Record button and select it.
    2. Select TXT from the drop-down.
    3. Leave blank the host box.
    4. In the text box, provide the string you find in your reserved area:
      1. link help Servermx: ServerMX Help page.
      2. link reserved area: your reserved area, in case you were connected at servermx.

If you want to know more information about servermx Mx record you can find at this link other details.