Info2Mail

<< Click to display Table of Contents >>

Navigation:  Interfaces >

Info2Mail

Sending Cordaware bestinformed-Infos as E-Mail

 

The integrated Info2Mail interface allows you to send Infos as E-Mails.

 

For sending Infos as E-Mail you will have to set up E-Mail Filters which are built similar to a regular filter. When addressing an Info to this filter, the Infoserver will distribute the E-Mail stop the designated recipients by using the defined method.

 

In order to create your own Info2Mail filter please follow these steps:

 

1.) Create a filter which you want to use for Info2Mail

 

2.) Now choose the type "info2Mail" and the operator "script.is_info2mail" "is not empty"

 

Info2Mail_Filter

 

3.) The following is a script example which can be used for the creation of an Info2mail Filter.

 


-module(info2mail).

-export([main/1]).

 

main(_) ->

 

  %%%-------------------------------------------------------------------

  %%% CONFIGURATION

  %%%-------------------------------------------------------------------

 

  %% Enter the SMTP server of your provider here.

  Relay = "",

 

  %% Enter the port used to communicate with the SMTP server.

  Port = 25,

 

  %% Enter your login name here, which you use to register with your mail provider.

  UsernameOrEmail = "",

 

  %% Enter your password into the Cordaware bestinformed password vault.

  %% Then enter here the alias of your password that you have defined in the password vault.

  PasswordAlias = "",

 

  %% Specify here whether you need to authenticate with your mail provider:

  %%  * true  = Authentication required

  %%  * false = Authentication not required

  Auth = false,

 

  %% Set your desired encryption method here. The following values are possible:

  %%  * tls  = TLS encryption

  %%  * ssl  = SSL encryption

  %%  * none = No encryption

  Secure = tls,

 

  %% Enter the mail addresses of the desired recipients here.

  %% Multiple recipients can be specified in a comma-separated list.

  %% Make sure that NO comma is added after the last recipient!

  To = [

    "recipient_1@mail.com",

    "recipient_2@mail.com"

  ],

 

  %% Enter the mail address of the sender here.

  From = "sender@mail.com",

 

  %% Enter the subject of the mail here.

  Subject = "New Info",

 

  %%%-------------------------------------------------------------------

  %%% INTERNAL FUNCTIONS

  %%%-------------------------------------------------------------------

 

  Mail = [

    {relay, Relay},

    {port, Port},

    {username, UsernameOrEmail},

    {password, PasswordAlias},

    {auth, Auth},

    {secure, Secure},

    {to, To},

    {from, From},

    {debug, fun(TO) -> best_script:debug_msg("Send email to: ~p", [TO]) end},

    {subject, Subject},

    {body, best_script:info()},

    {content_type, html}

  ],

  best_script:sendmail(Mail, []),

  true.

 


Please note:

 

If you want to use TLS or no secured connection for the SMTP, the following line in the script needs to be adjusted:

 

{secure,ssl},

 

Here you can use the following examples in order to use different security methods.

 

SMTP via TLS: {secure,tls},

 

SMTP without a secured connection: {secure,none},

 

If you have created the script, you can edit and save it as you like.

 

4.) After saving the filter, you can select the filter you just created as the recipient in the Infoeditor.

 


Please note: If your mail provider need a password to authenticate, the password have to set up in and safe in a password safe. You can enter the name of the password safe into  a example-script.