Manual: How to send an SMS by email


 

Before using this interface, think about using our http interface instead. It might be easier. The http interface requires an URL-Call for each single SMS.

  1. Converting emails to SMS: simple format (easy)
  2. Converting emails to SMS: XML format (more flexible)
  3. Receiving delivery reports
  4. Receiving replies
  5. Customized
  6. Solutions for known issues
  7. Program examples

1.) Converting emails to SMS: simple format

You can write an email with a mail-client of your choice and send this email in plain text format (not HTML) to our SMS interface sms@sms4.de.

The conversion will only work, if the email-address of the sender is known to the system. Add the sender�s email-address at Einrichten -> Email-Berechtigungen (setup->email-authorizations).
It�s necessary to assign outgoing SMS to each account. At Verwaltung->Email-Berechtigungen (setup->email-authorizations) ADMIN-users can grant or deny access to the interface for each user by adding or deleting the email-address. If you add a new user then the new user´s access to the interface is granted by default.

There is a doublet check on every job (i.e. email), which will be sent to the email-to-SMS interface sms@sms4.de. Emails which are sent with the same text to the same recipient within 24 hours will be filtered. This filter can be set back at Einrichten -> Versand-Optionen (setup->messaging options).

Please only send plain text emails, not HTML

Example 1:

Example 2:

The email must be formed as follows:

To:
Please enter email-address sms@sms4.de of our email->SMS interface.

Subject:
optional (will be ignored).

Body:
The body of the email must contain the SMS4.de keywords. The keywords are followed by a doublepoint: and the value.

KeySampleDescription
KUNDENNR (mandatory)KUNDENNR:XY12345Your SMS4.de customer ID. Get a free test account here
HANDYNR (mandatory)HANDYNR:01701010101
HANDYNR:491701010102
HANDYNR:436012345678
Destination numbers. Use a newline to separate the recipients, e.g.
HANDYNR:01701010101
HANDYNR:01701010102
or
HANDYNR:491701010101
HANDYNR:491701010102
Destinations outside Germany must be in international format with the according country code and without a leading + or 00, e.g. for Austria (+43):
HANDYNR:436012345678
or use key LAND (see below)
TEXT (mandatory)TEXT:This is my text\nnew lineText of SMS, max. 160 characters (ISO-8859-1). Linebreaks can be inserted by using \n in the text.
TEXT1
TEXT2
TEXT3
(optional, instead of TEXT)
TEXT1:This is my text in line 1
TEXT2:because it has more than 60
TEXT3:characters, the rest is in 2 and 3
Some email-clients automatically generate linebreaks after a certain number of characters e.g. 76 in Outlook. If you notice that your message is cut after about 70 chars, split the text in 3 lines like this:
TEXT1:Here are the first approx. 50 chars
TEXT2:Here are the next approx. 50 chars
TEXT3:Here are the next approx. 50 chars

Do not insert linebreaks (Return/Enter-key) in the text! Linebreaks can be realized by using \n in the text.
ABSENDER (optional)ABSENDER:Der-PeterThe originator (sender) for the SMS, supported only with tariff 1 and 5:
6 to 11 alphanumeric characters (no special chars) or 6 to 14 numerals. With tariff 5 - SMS to German landline phones - only numerals are allowed.
Set the default originator at Einstellungen (settings).
TARIF (optional)TARIF:1Possible tariff values are 1 or 7. For details see our Preisliste (tariff list).
Default value is 1, but you can set another user-specific value in Einstellungen (settings).
SENDEZEIT (optional)SENDEZEIT:12.05.2010 09:45The desired transmission time of the SMS, format dd.mm.yyyy hh:mm
LAND (optional) LAND:43
HANDYNR:06012345678
HANDYNR:06012345679
Country code of the destination numbers entered in HANDYNR without a leading + or 00. Can be used only once per email.
Do not use, if the phone numbers already contain the country code! This Combination:
LAND:43
HANDYNR:06012345678
HANDYNR:06012345679
will be sent to:
436012345678
436012345679
EMPFAENGER (optional)EMPFAENGER:HansAlternatively or additionally to the phone numbers entered in HANDYNR you can set the phone number by giving the name of the Empf�nger (Recipient).
If you want to send SMS to several recipients at the same time, seperate them with newlines, e.g.
EMPFAENGER:Hans
EMPFAENGER:Maria
NAME (optional)NAME:Hansalias for EMPFAENGER.
GRUPPE (optional)GRUPPE:morningshiftAlternatively or additionally to the phone numbers entered in HANDYNR you can set the phone numbers by giving the name of the Gruppe (group).
REPLYTO (optional)REPLYTO:reply_to@someone-else.deReplies (tariff 7) and delivery reports (tariff 1 and 7) won´t be sent to the user´s email address but to the email given in REPLYTO.
EMAILCC (optional)EMAILCC:copy_to@somebody.deSend an email copy of the job to EMAILCC. Possible values: group name, name of recipient or email address.
Not available in combination with SENDEZEIT.

 

2.) Converting emails to SMS: XML format

If you are looking for a way to transmit several SMS at the same time but with different texts, you can use our XML interface.
You can write an email with a mail-client of your choice and send this email in plain text format (not HTML) to our XML interface xml@sms4.de.

The conversion will only work, if the email-address of the sender is known to the system. Add the sender�s email-address at Einrichten -> Email-Berechtigungen (setup->email-authorizations).
It�s necessary to assign outgoing SMS to each account. At Verwaltung->Email-Berechtigungen (setup->email-authorizations) ADMIN-users can grant or deny access to the interface for each user by adding or deleting the email-address. If you add a new user then the new user´s access to the interface is granted by default.

There is a doublet check on every job (i.e. email), which will be sent to the email-to-SMS interface xml@sms4.de. Emails which are sent with the same text to the same recipient within 24 hours will be filtered. This filter can be set back at Einrichten -> Versand-Optionen (setup->messaging options).

Please only send plain text emails, not HTML

Example 1:

 

Example 2:

The email must be formed as follows:

To:
Please enter email-address xml@sms4.de of our XML interface.

Subject:
Your customer ID e.g. XY12345. Get a free test account here.

Body:
The body of the email must be formed as follows:

XML elementSampleDescription
<emailtosms>
...
</emailtosms>
(mandatory)

<emailtosms>
<sms>
  <text>test sms 1 with text 1</text>
  <handynr>01701010101</handynr>
</sms>
</emailtosms>

Top element of the email-to-SMS job
<sms>
...
</sms>
(mandatory)

<emailtosms>
<sms>
  <text>test sms 1 with text 1</text>
  <handynr>01701010101</handynr>
</sms>
</emailtosms>

Each SMS of the job is embedded in a block starting with <sms> and ending with </sms>.
<handynr></handynr>
(mandatory)

<emailtosms>
<sms>
  <text>2 sms with text 1</text>
  <handynr>01701010101</handynr>
  <handynr>01701010102</handynr>
</sms>
<sms>
  <text>1 sms with text 2</text>
  <handynr>01701010101</handynr>
</sms>
</emailtosms>

Destination numbers. If you want to send to several recipients, use multiple handynr elements, e.g.
<handynr>
017212345678
</handynr> <handynr>
017212345679
</handynr>
or
<handynr>
4917212345678
</handynr> <handynr>
4917212345679
</handynr>
Destinations outside Germany must be in international format with the according country code without a leading + or 00 e.g. for Austria (+43):
<handynr>
436012345678
</handynr>
<text></text>
(mandatory)

<emailtosms>
<sms>
  <text>Test SMS 1 with text 1</text> 
  <handynr>01701010101</handynr>
</sms>
<sms>
  <text>Test SMS 2 with text 2
  neue zeile</text> 
  <handynr>01701010101</handynr>
</sms>
</emailtosms>

Text of SMS, max. 160 characters (ISO-8859-1). If you want to send to several recipients at the same time, but with different texts, use multiple blocks with <sms></sms>.
<absender></absender>
(optional)

<emailtosms>
<sms>
  <text>test sms 1 with text 1</text>
  <handynr>01701010101</handynr>
  <absender>017212345678</absender>
</sms>
</emailtosms>

The originator (sender) for the SMS, supported only with tariff 1 and 7: 6 to 11 alphanumeric characters (no special chars) or 6 bis 14 numerals. Set the default originator at Einstellungen (settings).
<tarif></tarif>
(optional)

<emailtosms>
<sms>
  <text>test sms 1 with text 1</text>
  <handynr>01701010101</handynr>
  <tarif>1</tarif>
</sms>
</emailtosms>

Possible tariff values are 1 or 7. For details see our Preisliste (tariff list).
Default value is 1, but you can set another user-specific value in Einstellungen (settings).
<kundennr></kundennr>
(optional)

<emailtosms>
<kundennr>XY12345</kundennr>
<sms>    
  <text>test sms 1 with text 1</text>
  <handynr>01701010101</handynr>
</sms>
</emailtosms>

If you can�t change the subject of your email, put your SMS4.de customer ID in the email body. The kundennr element will be ignored, if there already exists a valid customer ID in the subject (i.e. customer ID in the subject overrides).
<replyto></replyto>
(optional)

<emailtosms>
<sms>    
  <text>Reply to other email</text>
  <handynr>01701010101</handynr>
  <tarif>1</tarif>
  <replyto>to@another.com</replyto>
</sms>
<sms>    
  <text>Report to other email</text>
  <handynr>01701010102</handynr>
  <tarif>1</tarif>
  <replyto>and@someothers.de</replyto>
</sms>
</emailtosms>

Replies (tariff 7) and delivery reports (tariff 1 and 7) won´t be sent to the user´s email address but to the email given in REPLYTO.
<sendezeit></sendezeit>
(optional)

<emailtosms>
<sms>
  <text>test sms 1 with text 1</text>
  <handynr>01701010101</handynr>
  <sendezeit>12.05.2010 09:45</sendezeit>
</sms>
</emailtosms>

The desired transmission time of the SMS, format dd.mm.yyyy hh:mm

 

3.) Receiving delivery reports

see (German): Sendeberichte per E-Mail erhalten

 

4.) Receiving replies

see (German): Antworten per E-Mail erhalten

 

5.) Customized

If your application can�t change the email body, we can develop a customized version of our gateway to your specifications for 100 EUR plus VAT.

 

6.) Solutions for known issues

Please make sure to set the email header as follows:

Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 8bit

There may occur problems with special chars (umlaut) or linebreaks if you don´t set the headers correctly. Keys may not be read in that case.

 

7.) Program examples

Example: Sending SMS (PHP)

<?
/* ============================================================
Sample code for sending SMS by email in simple format
Author: Joachim Nenning info@alphaQuest.de
www.sms4.de
==============================================================*/

$kdnr  = "XY12345";   // Please fill in your customer ID here

// originating number ( 6 to 11 chars oder 6 to 14 numbers )
// only with tariff 1
$absender="017488997766"; 

// number of destination
$handynr = "01701010101";

$text = 'just a test\n2. line'; // SMS text 

$tarif = 1; // tariff 1 supports originator-ID, delivery notifications and direct termination


// email address of the interface
$to = 'sms@sms4.de';

// authorized email sender
$from = 'my@authorized-email.de';

// subject: optional
$subject = 'test mail SMS4.de';

// Body
$message = "KUNDENNR:$kdnr
HANDYNR:$handynr
TEXT:$text
ABSENDER:$absender
TARIF:$tarif";



// build email header
$head='';
$head .= 'From: ' . $from . "\n";
$head .= "MIME-Version: 1.0\n";
$head .= "Content-type: text/plain\n";
$head .= "Content-Disposition: inline\n";
$head .= "Content-Transfer-Encoding: 8bit\n";


// send email
mail($to, $subject, $message, $head);
?>

 

Example: Sending SMS (Perl):

#!/usr/bin/perl

#####################################################################
#Sample code for sending SMS by email in XML format
#Author: Joachim Nenning info@alphaQuest.de
#www.sms4.de
#####################################################################

$kdnr= "XY12345";# Please fill in your customer ID here

# originating number ( 6 to 11 chars oder 6 to 14 numbers )
# only with tariff 1
$absender = "Der-Peter";

# number of destination
$handynr = "01701010101";

$tarif = 1;# tariff 1 supports originator-ID, delivery notifications and direct termination

# SMS text
$text = "test sms 1 with text 1
new line";

$to = 'xml@sms4.de';# email address of the interface

$from = 'my@authorized-email.de';# authorized email sender


open (SENDMAIL, "|/usr/lib/sendmail -oi -t") || die "Can't open Sendmail\n";
print SENDMAIL <<"...";
Subject: $kdnr
To: $to
From: $from
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

<emailtosms>
  <sms>
    <text>$text</text>
   <handynr>$handynr</handynr>
    <absender>$absender</absender>
    <tarif>$tarif</tarif>
  </sms>
</emailtosms>
...
close(SENDMAIL);

 

Example: Sending SMS from Nagios (Perl)

Read in our FAQ (German): Wie kann ich Alarmierungen von Nagios per SMS versenden?