Sending Email Messages with Authentication - Use of Email Servers that Need Authentication
Author(s):
Luis Noites - LESE
Industry:
Products:
The Challenge:
Develop a program with which it is possible to send email messages using servers in which it is necessary to authenticate the user.
The Solution:
Use of a program developed in the NI LabVIEW graphical environment that allows the transmission of email messages using any server, regardless of necessity to authenticate the user
"Use of a program developed in the NI LabVIEW graphical environment that allows the transmission of email messages using any server"
To accomplish the structural monitoring process of a new stone masonry bridge in Vila Fria - Portugal, over the Vizela River, it was necessary to send email messages with alarms. A program was developed to create the possibility to send all necessary emails. The implementation of the programme to send emails, required the development of a subprogram allowing the conversion of a sequence of characters into normal code (ASCII code) to its representation on “base64”, which is the code that is used by email servers to perform the authentication of the user. Sending Email Messages To send an email message it’s necessary to follow this procedure because after each of these actions there is a response from the server that is not transcribed. This script should be executed in the “command prompt”: “telnet server 25” - Starting a telnet session on port 25, replace “server” by the name of the email server, for example “telnet mail.bluebottle.com 25”. This was used because it is one the few free servers that provides SMTP access). “ehlo bluebottle.com”. “auth login”. Introduction of the authorized user (for example if the user is “Luis” it will be necessary to introduce “THVpcw==” which is the representation of the user name using the “base64” convention. After the introduction of the user it’s necessary to input the password for that user (for example if the password is “Noites” it’s necessary to input the value “Tm9pdGVz” which represents the “base64” convention of that password. “mail from: vila.fria@bluebottle.com” - Assuming that the email will be sent from the email address vila.fria@bluebottle.com, if this email does not exist the receiver cannot send a reply, but if it is only for sending, then it is not necessary to use a valid email address. “rcpt to: lese@fe.up.pt” – The email will be sent to lese@fe.up.pt. “data” Write the contents of the email message to send which can contain multiple lines. “.” - This serves to indicate that the user has fished writing the data for that email. This will only work if there is no more text in that line besides the dot. “quit” - This ends the telnet session, after which the server sends the e-mail).
Some of the existing blocks in the NI Internet Toolkit were used to fulfill these procedures. The first one to be used is “Open TCP Connection” with which it is possible to create a connection to the mail server on the desired port. In this case the mail server is mail.bluebottle.com and the port is 25. This opens a telnet session, which is a very important setting and it should be checked if the server that is being used is not blocking this port. After this step it is possible to send all the necessary commands using the “TCP Write”. To conclude it is necessary to close the connection to the server using the block “Close TCP Connection”.
“BASE64” encoding
To implement certain steps outlined above, it is necessary to convert the characters to their representation in “base64”. The “base64” encoding is based on the fact that any character has a decimal representation. This representation may be a number between 0 and 255. After which it is represented in bits, as we have to represent 256 different numbers it’s necessary the use of 8 bits (2 ^ 8 = 256 different values). This representation permits groups of 6 bits to form with which we perform the inverse operation described above. However as now we only have 6 bits, we can only represent 64 different values. These values can be converted to characters using a “base64” table. Since the problem focuses primarily on the use the “base64” table, this method was designated as “base64” encoding.
Conclusions
This program is one of the fundamental pieces for the acquisition system. Although it can easily be included in any project that requires events communication, such as sending emails (with the possibility of converting them to SMS) or sending SMS. SMS messages should be used with a server such as http://bulksms.vsms.net/, which allows the direct transmission of SMS. This uses an electronic server which makes it possible to send SMS in the same manner as a regular email message bearing in mind that this requires an authentication (that can be the same as the one used in regular emails) so that the SMS will be charged to the account responsible for this message by the server.
Related Case Studies
Monitoreo y Control Automático para el Entrenador de Procesos PT326 de la FeedbackEquipo ATE (VF 3522) Funcional con Visión Robotizado
Testing Wind Turbines: Controlling a Mobile Voltage Dip Generator Using NI PXI
SeaDP. Dynamic Positioning System for Split Hopper Vessels
Plataforma Para Test De Vibración VIT-1
|
|

