How to setup E-mail to SMS with Gmail

This article explains how you can send and receive SMS from a Gmail user account. It will show you the communication from the perspecitive of the Gmail user (james@gmail.com), and from the perspective of the mobile user (+3620111111). You will see that you need to create a technical e-mail accont (james-sms@gmail.com) to forward e-mails as SMS messages and you will see how your SMS gateway needs to be configured to accomplish this goal. The presented solution is a great example of an email to sms and sms to email configuration that can be created using Ozeki SMS Gateway.

What is E-mail to SMS?

Email to SMS is solution which allows you to turn an email into a text message without any extra effort

How to setup E-mail to SMS with Gmail (Short steps)

To setup E-mail to SMS with Gmail:

  1. Launch Ozeki SMS Gateway
  2. Install SMS modem connection
  3. Provide port name
  4. Specify phone number
  5. Add IMAP client
  6. Configure IMAP Server
  7. Modify SMTP settings
  8. Enable using address in subject line
  9. Send test e-mail to SMS from Gmail

E-mail user perspective (I am using E-mail)

Once the configuration is completed, the e-mail user can send an SMS, by sending an e-mail to james-sms@gmail.com. He needs to put the phone number into the subject line of the e-mail messages, and he needs to put the SMS text into the e-mail body (Figure 1).

E-mail to SMS using G-mail
Figure 1 - E-mail to SMS using G-mail

Mobile user perspective (I am using SMS)

When the mobile user receives this e-mail, he will see that it came from phone number +3620222222. He can send a reply SMS to this phone number. The reply SMS will be returned as an e-mail message to james@gmail.com. This configuration allows the two parties to communicate freely. James can use his desktop e-mail account and Mobile user can use his cellphone (Figure 2).

SMS to E-mail
Figure 2 - SMS to E-mail

What you need to create

To create this solution you need to create a technical e-mail account at G-mail. You can call this e-mail account james-sms@gmail.com. This e-mail account will serve as the e-mail address to send and receive e-mail on behalf of the SMS gateway.

You also need to create an SMS gateway setup. You can install the SMS gateway on Windows (Figure 3) or you can use the Android SMS gateway setup. If you install the SMS gateway on Windows we recommend you to connect your sms gateway to the mobile network using a GSM modem. In our example the SIM card you put into the GSM modem will have a phone number of +3620222222. Note, that there are other ways to connect your SMS gateway to the mobile network. For example you can connect to an SMS service provider using an SMPP client connection, or using a HTTP REST SMS api connection or you can connect to your Android Mobile phone and send sms through it.

In the SMS gateway you will also have to create an IMAP user connection to direct it to download e-mails from the james-sms@gmail.com inbox, and to send SMS messages as e-mail using the sender address of james-sms@gmail.com.

E-mail to sms gateway entities
Figure 3 - E-mail to sms gateway entities

How does E-mail to SMS work

The e-mail to SMS setup works because Ozeki 10 SMS Gateway can use IMAP and SMTP communication to interact with an e-mail account. In our example Ozeki 10 SMS gateway downloads the E-mails from the e-mail account using IMAP, and when it receives an SMS it will forward it as an e-mail through this e-mail account using an SMTP e-mail sending request.

Imap and SMTP is used to create E-mail to SMS
Figure 4 - Imap and SMTP is used to create E-mail to SMS

E-mail to sms (IMAP download)

In this configuration, when james@gmail.com sends an e-mail to james-sms@gmail.com, he needs to put the mobile telephone number (+3620111111) into the subject line, and he needs to write the SMS text into the body (Figure 5).

This e-mail will arrive to the Inbox of james-sms@gmail.com. The Ozeki SMS Gateway will download the e-mail from this inbox using an IMAP connection. After the e-mail is downloaded it will send it as an SMS. If you have attached a GSM modem to your SMS gateway, that has a phone number of +3620222222, the SMS sent by the SMS gateway will appear on the phone of Mobile user as if it was sent by +3620222222.

How to send SMS from G-mail
Figure 5 - How to send SMS from G-mail

SMS to E-mail (SMTP upload)

If Mobile user replies to the SMS, he will send a reply to the phone number +3620222222. This is the phone number of the SMS gateway. He will write his text e.g: "Hello James", and will send the messages. He does not know, that his sms will end up in an e-mail box.

When the SMS gateway receives this SMS, it will create an E-mail. It will send the e-mail to james@gmail.com. The from field of the e-mail will be james-sms@gmail.com, the subject will be the phone number of the Mobile user (+3620111111), and the e-mail body will be the SMS text ("Hello James").

The e-mail will be sent as an SMTP E-mail submit request to the G-mail SMTP server. The user account james-sms@gmail.com will be used to login to G-mail to send the SMS. After the e-mail has been sent by the SMS gateway, james@gmail.com will receive this e-mail. He will see that the e-mail cam from jame-sms@gmail.com, and he will see the phone number of the mobile user (+3620111111) in the subject line. If he wants he can reply to this e-mail.

How to send SMS to G-mail
Figure 6 - How to send SMS to G-mail

Install SMS modem

To install a new SMS modem, you need to open the Connection install list. To do so, look for the blue Add new connection button located on the left-side panel of the Ozeki SMS Gateway home page (Figure 7). On the Install list, look for the SMS modem item and click the Install button next to it.

install new sms modem
Figure 7 - Install new SMS Modem

Provide a port and a phone number

In the Serial port groupbox, you need to provide information about the port that the connection will use. You can use the autodetect function to automatically determine the correct port number. In the Telephone number groupbox, you need to provide a phone number for this connection (Figure 8). After your have done the setup, click the Ok button.

specify modem port and phone number
Figure 8 - Specify modem port and Phone number

Install IMAP client

To setup the IMAP client which will check your email account for incoming messages, you need to create a new application. To do so, check for the blue Add new user/application button located on the left-side panel of the Ozeki SMS Gateway. You will be presented with the Add user or application install list. Look for the IMAP client option and click the blue Install button next to it (Figure 9). This will take you to the IMAP client setup page.

install new imap client
Figure 9 - Install new IMAP client

Configure the IMAP Server

In the next step, you need to configure the IMAP server. You can find the IMAP server groupbox if you scroll down in the General tab. You can find a Host textbox where you need to provide host address of the mail service your are using. For Gmail, it is imap.gmail.com. The port textbox needs the port number that the connection will use. The username and the password textbox will need the login credentials of the gmail user account (Figure 10). This way, the IMAP client will be able to login to the mail server.

imap server configuration
Figure 10 - IMAP server configuration

In the SMTP tab, you need to provide the address for a sender and a recipient. Then you need to fill in the required information for the SMTP server. You need the host address which is smtp.gmail.com, a correct port number and the login information for the SMTP server (Figrue 11).

Configure the SMTP

smtp server configuration
Figure 11 - SMTP server configuration

Use the subject line as the address

Click the IMAP tab and look for the checkbox titled Use address in the subject line. This way the subject of the message will be the address where you need to send a message (Figure 12).

configure imap client to use address in subject line
Figure 12 - Configure IMAP client to use address in subject line

Final thoughts

Now, you can pause and catch your breath. We hope you didn’t get lost in the explanations. We did our very best to make it simple and to walk you through all the details as painlessly as possible. If you have followed the steps closely, you should be able to send sms messages using the E-mail to SMS system with Ozeki SMS Gateway without issues. If you have already completed the steps you can enjoy a well deserved chocolate or some other treat you have in mind. If you would like to receive more valuable information about the benefits of other smiliar solutions, please open ozeki-sms-gateway.com.

More information