Topic Keywords: E-Mail, E-Mail to MMS Gateway, E-Mail to SMS Gateway, IMAP, POP3
E-Mail to SMS & MMS Gateway with NowSMS
Quick Start Guide
One of the typical usage cases for NowSMS is as an E-Mail to SMS & MMS Gateway.
- E-Mail users can send an SMS or MMS message by sending an e-mail message to the NowSMS Gateway.
- NowSMS converts the message to SMS or MMS format to deliver the message to a mobile phone.
- If the mobile phone subscriber replies back with an SMS or MMS, NowSMS can deliver the reply back via e-mail to the original e-mail sender.
NowSMS supports two different configurations for e-mail functionality:
Shared Mailbox Configuration: E-mail users send to a special e-mail address, and specify the recipient phone number at the start of the subject line. (Note: Instead of a phone number, an address book name or distribution list name can be specified in the subject line, making it easier to send messages.)
The Shared Mailbox Configuration is the easiest to configure, as it only requires a normal POP3 or IMAP mailbox. From an internet e-mail architecture perspective, the NowSMS server functions as a POP3 or IMAP client.
SMS Domain Name Configuration: E-mail users specify the recipient phone number as part of the e-mail address (for example, 447777777777@sms.company.com).
The SMS Domain Name Configuration is more complex, because in this configuration, the NowSMS server functions as an SMTP mail server. From a novice perspective, this means that the NowSMS server must be able to accept SMTP connections from the open internet, and an MX record must be defined for the domain name part of the e-mail address (e.g. sms.company.com) that points to the internet address of the NowSMS server.
For most customers, we recommend the Shared Mailbox Configuration. The SMS Domain Name Configuration is powerful, but unless your organization manages its own dedicated e-mail servers, you will likely not have the experience or resources to deploy it. In other words, if your existing e-mail account is with Gmail or another cloud based provider, we strongly recommend the Shared Mailbox Configuration.
NowSMS Lite only supports the Shared Mailbox Configuration. NowSMS Lite specific functions can be found at https://nowsms.com/email-to-sms-mms-gateway-with-nowsms-lite.
Prerequisites
- NowSMS must be installed and able to send SMS and/or MMS Messages.
- For the Shared Mailbox Configuration: A POP3 or IMAP4 e-mail account must be created exclusively for use by NowSMS. NowSMS will automatically delete all e-mail messages from the mailbox as they are processed, so this account should be used only for NowSMS.
- For the SMS Domain Name Configuration (unless deployed privately as part of an enterprise e-mail system):
- An internet DNS hostname (A or CNAME) record must exist and resolve to an IP address that allows external connections to the SMTP Port (TCP Port 25) on the NowSMS server.
- If the NowSMS server is behind a router or firewall, a port forward entry may need to be defined in the router or firewall to allow external connections.
- An internet DNS MX (Mail eXchange) record must exist for the domain name portion of the SMS e-mail address, pointing to the A or CNAME record that points to the NowSMS server.
Step 1a: (Shared Mailbox Configuration) Connect the E-mail Account
On the “E-Mail” page of the NowSMS configuration, select “Use External IMAP or POP3 Mailbox”. Then press the “SMS Mailbox Settings” button.
E-Mail Address is the e-mail address associated with the account.
Full Name is a descriptive name to be included in the “From” field when e-mail messages are sent by NowSMS.
The remaining settings define how to connect to the mail server for this account. The mail server should support IMAP or POP3 for inbound e-mail, and SMTP for outbound e-mail. The same User Account and Password will be used for both inbound and outbound e-mail connections.
The inbound mail server must support either IMAP or POP3. The IMAP IDLE command is automatically used if available, allowing NowSMS to maintain an “always active” connection to the mail server and receive “push” e-mail. For POP3 connections, or if IMAP IDLE is not supported, NowSMS will check the mail server for new messages periodically based upon the number of seconds configured for the Poll Interval.
(Hint: Gmail supports IMAP IDLE.)
If SSL/TLS is enabled, NowSMS will use encryption for both inbound and outbound connections.
Server addresses can be either a host name or IP address, followed by a port number.
The default POP3 port is 110, or 995 when SSL/TLS is enabled.
The default IMAP port is 143, or 993 when SSL/TLS is enabled.
The default SMTP port is 25, or 587 when SSL/TLS is enabled.
When the OK button is pressed, NowSMS will verify that it can connect to the mailbox, and if successful, return to the E-Mail settings configuration screen.
If an error is reported, the error message should provide more details on the cause of the problem.
Error messages that start with the text “Connection Failed” are basic connectivity failures, indicating that a TCP/IP connection to the specified server was not possible. In these cases, check that the host name and port number are correct. In some environments, a network firewall may need to be reconfigured to allow the connection.
Step 1b: (SMS Domain Name Configuration) Enable the SMTP Server
On the “E-Mail” page of the NowSMS configuration, select “Function as an SMTP Server”. For standard SMTP configurations, the “SMTP Port Number” should be set to 25.
“Enable E-Mail to SMS Support” should be enabled.
NowSMS will only accept email to SMS or MMS messages if they are configured for the domain name specified for “Domain Name for SMS E-Mail”. This is the domain name or subdomain that has been allocated to NowSMS. For example, if NowSMS will be using the e-mail address format number@sms.company.com, this setting should specify sms.company.com as the domain name.
(If you need to accept mail using multiple domain names, there are advanced settings to add additional aliases for this domain name.)
Press the Apply button to save configuration changes.
With these settings, NowSMS is now configured as an SMTP server, waiting for other SMTP mail servers to connect on TCP port number 25 when there are messages to be delivered.
In order for this to happen, other SMTP servers need to know how to connect to your server when they have a message to deliver to your domain.
Within an enterprise mail system, another SMTP server may be configured to relay messages for your SMS domain name. Otherwise the following steps must be taken:
- An internet DNS hostname (A or CNAME) record must exist and resolve to an IP address that allows external connections to the SMTP Port (TCP Port 25) on the NowSMS server.
- If the NowSMS server is behind a router or firewall, a port forward entry may need to be defined in the router or firewall to allow external connections.
- An internet DNS MX (Mail eXchange) record must exist for the domain name portion of the SMS e-mail address, pointing to the A or CNAME record that points to the NowSMS server.
DNS considerations such as the above are not specific to NowSMS, they are basic considerations for any SMTP server.
The MMSC Service must be enabled for the SMTP server to function. For troubleshooting, details of SMTP connections will be logged to the MMSCDEBUG.LOG.
When NowSMS receives an SMS or MMS to route back to e-mail, NowSMS can either function as an “SMTP Smart Mailer” or relay all outbound mail through another SMTP server that acts as an “SMTP Relay Host”. When acting as a smart mailer, NowSMS performs DNS MX record lookups and connects directly to destination SMTP servers to deliver e-mail messages. Some SMTP servers may consider your e-mail messages to be SPAM if you are connected to an ISP with a consumer (not business) account. Some SMTP servers will also reject your e-mail if there is no reverse DNS record (in-addr.arpa PTR record) associated with the IP address of your NowSMS server.
These DNS considerations are very complex. If you are unfamiliar with these DNS terms and considerations, we strongly recommend the Shared Mailbox Configuration for the NowSMS E-Mail Gateway.
Further information on these DNS concepts can be found in the following Wikipedia articles:
http://en.wikipedia.org/wiki/Domain_Name_System
http://en.wikipedia.org/wiki/List_of_DNS_record_types
http://en.wikipedia.org/wiki/MX_record
http://en.wikipedia.org/wiki/Reverse_DNS_lookup
Step 2: Define Which E-Mail Users can send to SMS/MMS
The “Authorised E-Mail to SMS/MMS Senders” button is used to define what e-mail users are allowed to send SMS and/or MMS messages through your gateway.
This Authorised list can specify individual e-mail addresses such as user1@domain.com, or to specify that all e-mail users in a domain should have access, use the wildcard format *@domain.com.
Step 3: Send an E-Mail Message to SMS
From an e-mail client, try sending a message to the e-mail account we configured in the previous step.
The subject line of your e-mail address should start with the phone number that should receive the SMS. The body of the email message should contain the text that should be sent.
It may take several minutes for the message to be routed, depending on the polling interval setting and whether or not the mail server supports IMAP IDLE push e-mail.
If the SMS message is not received, it may be necessary to enable the MMSCDBUG.LOG for further troubleshooting. Or, for the SMS Domain Name Configuration, use tools such as mxlookup to verify DNS is configured correctly, and telnet to verify that SMTP port 25 is externally accessible.
If further assistance is required, please open a support thread on our technical support forum at https://nowsms.com/messages.
Step 4: Routing SMS/MMS Replies Back to E-Mail
If the recipient of the text message replies back, NowSMS can automatically route the reply back to the original e-mail sender if “Automatically Route SMS Replies to E-Mail” is enabled. (Hint: Press the Apply button to activate a changed setting.)
Note that when, “Automatically Route SMS Replies to E-Mail” is enabled, if an SMS or MMS message is received from a phone number that has previously been sent to via the E-Mail gateway, any 2-way commands will not be processed, and the content of the message will be sent back as a reply to the last e-mail address that sent a message to that phone number.
For further clarification, consider the following scenarios where multiple agents or workers share the same NowSMS e-mail gateway.
Send and Reply Scenario 1:
- Agent1@domain.com sends a message to Joe at +441234567890.
- Joe receives a text message from the phone number associated with the modem attached to NowSMS. If using the default configuration settings in NowSMS, the text message will start with the e-mail address that sent the message, in this case Agent1@domain.com.
- Agent2@domain.com sends a message to Tom at +447777777777.
- Tom receives a text message from the phone number associated with the modem attached to NowSMS. If using the default configuration settings in NowSMS, the text message will start with the e-mail address that sent the message, in this case Agent2@domain.com.
- If Joe replies to the text message, the reply will be sent to Agent1@domain.com. If Tom replies to the text message, the reply will be sent to Agent2@domain.com.
Send and Reply Scenario 2:
- Agent1@domain.com sends a message to Joe at +441234567890.
- Joe receives a text message from the phone number associated with the modem attached to NowSMS. If using the default configuration settings in NowSMS, the text message will start with the e-mail address that sent the message, in this case Agent1@domain.com.
- Agent2@domain.com sends a message to Joe at +441234567890.
- Joe receives a text message from the phone number associated with the modem attached to NowSMS. If using the default configuration settings in NowSMS, the text message will start with the e-mail address that sent the message, in this case Agent2@domain.com.
- If Joe replies to the text message, the reply will be sent to Agent2@domain.com. It is not possible for Joe to reply to Agent1@domain.com.
In Scenario 2, because modern smart phones display threaded SMS and MMS conversations, and because the e-mail address of the sender is shown at the start of the text message, it should be clear which e-mail address will receive the reply.
To avoid potential problems with Scenario 2, the full version of the Now SMS/MMS Gateway can use multiple modems and/or multiple phone numbers with a service provider. When there is a potential issue with a recipient phone number being contacted by multiple e-mail senders, NowSMS can choose a different modem or sender phone number and maintain multiple conversations.
Step 5: Additional Advanced Settings
There are several other advanced settings available for e-mail gateway processing.
SMS messages have size constraints. For most Latin based languages in Europe and the Americas, it is possible for a single SMS text message to contain up to 160 characters. Longer messages can be sent, but they are sent in separate segmented messages of up to 153 characters each. These segmented messages contain special headers that allow the receiving device to reassemble the message and show it as a single long message.
For other languages, the size restriction is 70 Unicode characters in a single message, or 67 characters per segment for long messages.
“Max SMS messages per e-mail” specifies that if an e-mail message is longer than this number of segments, the e-mail message will be truncated when it reaches the maximum number of SMS segments.
“Use MMS if SMS E-Mail includes image or exceeds text length for SMS” specifies that if an e-mail message exceeds the maximum number of SMS segments, or if the message contains an image attachment, the email should be converted into MMS instead of SMS for delivery.
“Use MMS for all messages from E-Mail” forces the use of MMS for all converted e-mail messages, instead of SMS.
“Automatically Route SMS Replies to E-Mail” was described in the previous section.
“Sender Phone Number(s) for E-mail to SMS” is used to specify which modem or sender phone numbers should be used for e-mail gateway functionality. This can be a single phone number, a comma delimited list of phone numbers, or a range of consecutive phone numbers or short codes.
For example:
+447777777777
+447777777777,+441234567890
+447777777700-+447777777799
88000-88999
To understand why it may be desirable to allocate multiple sender addresses, please refer to the Send and Reply Scenarios in the previous step.
For modem connections, any sender phone number listed here should be defined as the “Phone Number” for the modem under “Properties” for the modem in the “SMSC” configuration.
“Request Delivery Reports when sending from E-Mail” sets a request for delivery reports when an e-mail message is converted to SMS or MMS. Not all mobile operator networks support delivery reports, but where supported, an e-mail reply will be generated back to the sender to provide confirmation of message delivery. (Advanced note: It is also possible to configure NowSMS to generate an interim delivery report when it has posted the message to the mobile operator. For details on this interim report setting, please visit the support forum of our web site at https://nowsms.com/messages.)
“SMS E-Mail Template” specifies a formatting option for how the e-mail message is converted to a text message. For example, some configurations have asked not to include the e-mail sender address in the text message.
Press the Apply button to save configuration changes.
Step 6: Route Other SMS/MMS to E-Mail
Thus far, we have focused on E-Mail to SMS & MMS with support for routing mobile originated replies. It is also possible to forward any received SMS or MMS message to an e-mail address. This is done for SMS messages on the 2-Way configuration page.
“Process received SMS Messages” should be enabled.
“Use 2-way command processor” should be enabled.
Add or Edit the 2-way command table with a command to forward received SMS messages to an e-mail address.
Use * as a Keyword to match any received SMS message.
Check “Forward to E-Mail Address” and specify the e-mail address to which received SMS messages should be sent.
To forward received MMS messages to an e-mail address, it is necessary to apply settings individually for each modem or inbound MMSC VASP connection.
To configure MMS forwarding for MMS messages received via a modem, go to the “SMSC” page of the NowSMS configuration. Highlight a modem and press the “Properties” button.
Press the “MMS Receive Settings” to access the e-mail forwarding option.
After setting the “Forward to E-Mail Address” value, press the “OK” button to save the setting. Press “OK” again to return to the “SMSC” list.
Step 7: Distribution Lists and Address Books
To avoid remembering phone numbers, distribution lists and address books can be created in the NowSMS web interface.
Note: Only distribution lists are supported for the SMS Domain Name Configuration at this time. The Shared Mailbox Configuration supports both distribution lists and address book entries.
All authorized e-mail senders have access to send to public distribution lists or public address book entries. To add or edit public entries, it is necessary to login to the NowSMS web interface with credentials of an SMS User account with “Admin Access”.
APIs are also available for creating and updating these entries using HTTP or direct access to text files.
It is also possible for individual e-mail users to have their own address book and distribution lists. To access this functionality, create an SMS User account where the user name matches the full e-mail address of the e-mail user.
For comments and further discussion, please click here to visit the NowSMS Technical Forums (Discussion Board)...