Эта страница является
переводом страницы
E-mail. Перевод выполнен на 100%.
E-mail notifications
Manual on sending E-mail notifications from i3 pro or iRidium Server.
Description
Sending e-mails is realized on the basis of the AV & Customs Systems driver. The driver interacts with your account on the mail server. You can use this driver to realize getting notifications about activation of relays, smoke or motion sensors, other devices and to send e-mails without leaving the i3 pro app. The given example uses Gmail mail server, but you can edit it to send e-mails via another SMTP-server. To do it, the following data must be edited: SMTP-server: smtp.gmail.com, port: 465, login: your_login@gmail.com, password: password and the authorization answer from SMTP-server (see the example).
1 Allow the app to send messages via you gmail account. To do it, provide insecure apps access to your account:
https://www.google.com/settings/security/lesssecureapps
or send a letter and you'll get a message about an insecure app. Provide access to insecure apps.
2 Download the example given above.
3 Open "Gmail_SMTP_sample" script and enter required data:
- name_from - the name of a sender of a letter;
- email_from - e-mail of your Gmail account ;
- password - password of your Gmail account ;
- email_to - e-mail of the receiver of a letter;
- header - the heading of a letter;
- message - the message of a letter
Example:
function try_to_send ()
{
send_email("From Smart Home", "******@gmail.com", "12345", "destinationaddress@anydomain.com", "Header of message", "Text of message")
}
Only text is entered in the "message" field. (no attached documents or images).
4 Assign the "Send email" command to an event.
5 To send an e-mail message activate an event (for example, call a function with pressing a button)