Subsections of for system integrators

smtp without authentication

smtp open port

Sometimes old softwares or very simple applications
do not allow to issue a secure authentication as RealSender requires.

The solution is to provide an open a port to go through the smtp server,
checking only the connection’s ip address and the sender’s email address.

In this way you’ll be able to send your email messages without authentication,
but you will always be allowed to authenticate whenever possible.

RealSender partners and large organizations
can independently update the list of authorized IPs.


Request a free trial

sending via api

Topics in this area:

overview

server address, mandatory parameters, JSON answers

details

charset, content-type, optional parameters, JSON responses

examples

php and curl examples

examples with attachments

php and curl examples with attachments

Subsections of sending via api

overview

RealSender lets you send email messages via API (Application Programming Interface).

In this way you can dispatch the emails directly from your application, without passing through smtp (Simple Mail Transfer Protocol). We currently support POST requests only.


Server address:
https://rsXXX-api.realsender.com/mail/send


Required/mandatory parameters:

Parameter
Description
apiuser authentication user name
apipass authentication password
from sender email address
to recipient email address
subject subject of the email
text email body in plain text
html email body in HTML format

If everything is ok, the message will be sent and you will receive a positive JSON answer:
{"success":true}

In case of errors you will get something like this:
{"success":false,"errorMsgs":["Please provide the 'subject' value."]}


API Details

details

The contents must be sent using the UTF-8 international charset.
To test it, add “€uro” in your subject and submit it. If the charset is wrong, you will receive this JSON warning:

{"success":false,"errorMsgs":["The 'subject' value is not correctly encoded. It must be UTF-8 encoded."]}


Depending on whether you have filled in one or both the fields “text” and “html”, the messages will be sent using one of these “Content-Type”:

Parameter
Description
text text/plain (text only)
html text/html (html only)
text+html multipart/alternative (both text and html)
email client settings will decide which part is displayed

Not required/optional parameters:

Parameter
Description
fromname sender description
toname recipient description
replyto email address that will receive the replies
returnpath email address that will receive the bounced mails
it must be present among the RealSender’s authorized senders
cc carbon copy email address
ccname carbon copy description
bcc blind carbon copy email address
bccname blind carbon copy description
attach file(s) to be attached - can be present multiple times in the form - 3MB max weight
the file contents must be part of the multipart HTTP POST
enctype=“multipart/form-data” is required for INPUT TYPE=FILE

To, cc and bcc values can contain a single email address or a comma separated list of email addresses.
!! Within RealSender the total number of recipients for each piece of email is limited to 25 (it can be increased up to 100).


The server’s responses are in JSON (JavaScript Object Notation) format:

Description
Response
email sent {"success":true}
email NOT sent {"success":false,"errorMsgs":["..."]}

API Examples

examples

POST request
CURL-less method with PHP

<?php
$url = 'https://rsXXX-api.realsender.com/mail/send';
$data = array('apiuser' => 'the one we provided you', 'apipass' => 'the one we provided you', 'from' => 'sender@example.com', 'to' => 'recipient@example.com', 'subject' => 'subject of the message', 'text' => 'email body in plain text', 'html' => 'email body in HTML format');

// use key 'http' even if you send the request to https://...
$options = array(
    'http' => array(
        'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
        'method'  => 'POST',
        'content' => http_build_query($data),
    ),
);
$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
?>

POST request
CURL method

curl -d 'apiuser=the one we provided you&apipass=the one we provided you&from=sender@example.com&to=recipient@example.com&subject=subject of the message&text=email body in plain text&html=email body in HTML format'https://rsXXX-api.realsender.com/mail/send

API Examples with attachments

examples with attachments

POST request with attachments (max 5: attach1, attach2, …)
CURL-less method with PHP

<?php
require_once 'HTTP/Request2.php';

$config = array('use_brackets' => false,
               );

$request = new HTTP_Request2('https://rsXXX-api.realsender.com/mail/send',
                             HTTP_Request2::METHOD_POST,
                             $config);

$data = array('apiuser' => 'the one we provided you',
              'apipass' => 'the one we provided you',
              'from' => 'sender@example.com',
              'to' => 'recipient@example.com',
              'subject' => 'subject of the message',
              'text' => 'email body in plain text',
              'html' => 'email body in HTML format');
foreach ($data as $k => $d) {
    $request->addPostParameter($k, $d);
};
$request->addUpload('attach1', './sample.pdf', 'sample.pdf', 'application/pdf');
$request->addUpload('attach2', './sample.txt', 'sample.txt', 'text/plain');

$result  = $request->send();
var_dump($result);
?>

POST request with attachments
CURL method

curl -F 'apiuser=the one we provided you' \
      -F 'apipass=the one we provided you' \
      -F 'from=sender@example.com' \
      -F 'to=recipient@example.com' \
      -F 'subject=subject of the message' \
      -F 'text=email body in plain text' \
      -F 'html=email body in HTML format' \
      -F 'attach=@sample.pdf;type=application/pdf' \
      -F 'attach=@sample.txt;type=text/plain' \
      https://rsXXX-api.realsender.com/mail/send

sending via http request

Topics in this area:

overview

script address, mandatory parameters, hidden and non-hidden fields

details

not required / optional parameters, hidden and non-hidden fields

web form example

simple html web form example

sms to http example

sms forwarding to http configuration example using Teltonika routers

Subsections of sending via http request

overview

RealSender lets you easily submit http requests, such as web forms contents, via email messages.
In this way you can receive the results of your feedback forms directly in your mailbox.

There’s no need of any special configuration on your side.
The forms can be published in any html webpage or added directly within your email messages.


Script address:
<form action="https://rsXXX.realsender.com/script/form.pl" method="post" accept-charset="utf-8">


Required/mandatory parameters (hidden fields):

Parameter
Description
recipient the email address or the “alias” to which the form submission will be sent
for security reasons, the “real” address should be configured at sever level
required this is a list of fields that the user must fill in before they submit the form
we suggest to check the “email” field only (content and syntax are verified)
additional checks are usually done via javascript, we can provide examples
redirect the user will be redirected to this URL after a successful form submission
missing_fields_redirect the user will be redirected here if any of the ‘required’ fields are left blank

Required/mandatory parameters (non-hidden fields):

Parameter
Description
email it will become the sender’s email address of the message
if the email address
is correct
the data will be sent to the configured recipient
the user will be redirected to the “redirect” URL
if the email address
is missing or syntatically wrong
no mail will be sent
the user will be redirected to the “missing_fields_redirect” URL

HTTP REQUEST details

details

Not required/optional parameters (hidden fields):

Parameter
Description
subject the subject line for the email
env_report a list of the user’s environment variables that should be included in the email
useful for recording things like the IP address of the user, example:
value=“REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT”
print_blank_fields if this is set to “1” then fields left blank will be included in the email

Not required/optional parameters (non-hidden fields):

Parameter
Description
realname the user’s full name, it will become part of the sender’s email address
any_other_field you can add as many fields you need, no setup is required at server level

The encoding that will be used for the form submission is the UTF-8 international charset.
To test it, add “€uro” in any of your fields, submit the form and check the email message you’ll receive.


WEB FORM example

web form example

This is a simple html web form example
with two optional parameters: “realname” and “notes”

<form action="https://rsXXX.realsender.com/script/form.pl" method="post" accept-charset="utf-8">
    <input type="hidden" name="recipient" value="email_address-or-alias" />
    <input type="hidden" name="required" value="email" />
    <input type="hidden" name="redirect" value="/form/thankyou.html" />
    <input type="hidden" name="missing_fields_redirect" value="/form/error.html" />
        Name:<br />
        <input name="realname" /><br />
        Email:<br />
        <input name="email" /><br />
        Notes:<br />
        <textarea cols="40" rows="2" name="notes"></textarea><br />
        <input type="submit" />
</form>

The “redirect” and “missing_fields_redirect” landing pages can reside on your server.
You can add as many fields you need, no setup is required at server level.


SMS to HTTP example

sms to http example

To receive SMS messages directly in your mailbox
Teltonika routers offer the “SMS Forwarding To HTTP Configuration” option.

You can find it within the Teltonika WebUI: Services > Mobile Utilities > SMS Gateway.
!! The recipient’s domain (yourdomain.com) must be pre-authorized by RealSender !!

Number value name: email

Method: Post
URL:    https://rsXXX.realsender.com/script/sms.pl

Message value name: message
Extra data pair 1:  recipient | name@yourdomain.com
Extra data pair 2:  subject   | Text-Message

SMS Forwarding To HTTP Configuration


Option 1 - using MOBILE DATA

!! A 4G (LTE) connection is required to work properly with RealSender !!
You can setup it up inside Teltonika WebUI: Network > Mobile > SIM card settings

Network type: 4G (LTE) only

Mobile SIM card settings 4G (LTE) only


Option 2 - using LAN GATEWAY DATA

You can set the internet gateway to go through your LAN.
Teltonika WebUI: Network > LAN > NETWORK INTERFACES > [edit]

Network interfaces - LAN

Just configure the IPv4 gateway and the DNS servers
see the example below (modify it with your own parameters):

INTERFACES: LAN 
...
IPv4 gateway: 192.168.1.1
DNS servers:  8.8.8.8     !! mandatory !!

The Mobile Data Connection can be disabled in a few ways, see: Disable Mobile Data.
When mobile data is disabled, SMS messaging remains operational.

The easiest way to Disable Mobile Data, is to TEXT to the mobile number: <router_password> mobileoff
You can check the changes in the same way, using the “status” command: <router_password> status


Example of email message received
Subject: Text-Message (+41790000000)

Below is the received text message.  It was submitted by
 (+41790000000) on Monday, June 26, 2023 at 08:31:29 CEST
---------------------------------------------------------------------------

Test Message

---------------------------------------------------------------------------

formmail app

formmail

Receiving clear and structured information via the internet can be complicated.
It needs a user interface to fill in and a server application that sends the data.

RealSender’s “formmail” app lets you create simple and responsive forms,
therefore usable also on tablets and smartphones with small screens,
that will send the data directly to your email address.

Few “Drag & Drop” components
will help you structure your questions:

drag and drop components

The source is downloadable
in a ready-to-use “form.html” file:

rendered source of your form download

You can try it yourself at formmail.realsender.com/forms

  • add a “Text Input” field and a “Button”, that will let you submit the form your form
  • click the “Download” button within the “Rendered” tab to save the file locally
  • open form.html and enter some text and press the button to submit the contents
    (ATTN: because it’s not published online, the “Thank You” page will be coarse)

The message is received in the RealSender’s “temporary email” service.

Request a free trial if you want to publish the html file online.
You will thus get an elegant confirmation popup:

form-success

The entered data will be delivered directly to your email box.


Request a free trial

smsgateway app

maximize email

Broaden your perspectives. Connect your emails to the mobile world.
Maximize your business communication possibilities, without changing your habits.

Send SMS from your email

Push notifications are the most effective way to reach your customers quickly.
With super high open rates (up to 95%) and top response rates (up to 45%).

Recipient: mobilenumber@sms.yourdomain.com
Subject:   the SMS message content

(additional email content and attachments are ignored)

Setup requires a Teltonika industrial router and a SIM from your mobile operator.
Our staff or one of our partners can provide you with the details and help you with the settings.

Control over the sending and delivery of text messages must be carried out via the operator used.
Our system checks every ten minutes that the router is responding (check power and internet connection).

To avoid abuses, which can happen by forging the sender’s identity (spoofing),
messages must be sent via RealSender, using pre-authorized senders,
with the SPF and DKIM “strict” alignment. Learn more on email authentication - advanced.

» back to top


Reply to SMS from your email

RealSender’s “smsgateway” app lets you send SMS text messages directly from your EMAIL.

The text message received will be delivered directly to your preferred mailbox,
with an email message like this:

Subject: Text-Message (+41790000000)

Below is the received text message.  It was submitted by
 (+41790000000) on Monday, July 29, 2023 at 10:57:00 CEST
---------------------------------------------------------------------------

Test Message

---------------------------------------------------------------------------

So you can reply from your favorite email application.
The recipient address is already filled with the original sender number:

Recipient: mobilenumber@sms.yourdomain.com
Subject:   the content of the reply SMS message

(additional email content and attachments are ignored)

The conversation between email application and mobile device can thus continue.

» back to top

Just write “[A]” in the text and add an attachment to the email.
The “smsgateway” app will automatically convert it into a link.

The domain in the link can be any dedicated domain or subdomain you wish to use.
The file will be DELETED after twelve months.

» back to top


Request a free trial