Sending an email via button click in ViewOn

I have created a simple viewon dashboard but would like to add a small feature.
I want to send an email whenever I click a button. The email will stay the same so
I don’t need to update the email, how can I do this?

It is actually pretty easy to accomplish this. It is even easier because we are just using a static email address.
What you will want to do is assign a BASIC script to your button. So when you click the button, it will execute the scrip thus sending the email out!

The script is only a few lines of code (though it can be even shorter).

The below script will allow you to fill in the blanks to send whatever you would like.

t$ = "To email address"
c$ = "CC email field"
s$ = "Email Subject"
b$ = "Email Body"
SENDMAIL t$, c$, s$, b$

To add this into your ViewOn project do the following:

  1. Add a button to your view

  2. Select Actions from the lower left submenu.

  3. Next click the icon inside of the action panel.

  4. Select Send --> Command

  5. Now under the Tag to write field, click the small icon.

  6. Select BASIC Script and add the above script to that section.

  7. Finally, just select OK.

You are all done with this part!

NOTE:

  1. You must have an SMTP server configured on your eWON. If you do not have a server provided by your company, feel free to use the Talk2M Free email relay. .
    https://websupport.ewon.biz/sites/default/files/kb-0046-0-en_email_and_sms_relay_using_talk2m.pdf
  2. You can execute more than just an email function here. You may update tags, send sms messages and more!

https://developer.websupport.ewon.biz/system/files_force/RG-006-0-EN-(Programming%20Reference%20Guide).pdf?download=1

Hopefully this helps. Let me know if you have any further questions.

Hi Jseanor,

it worked fine thanks for that.
i still have a questions because i’m not so familiar with the scripting.
the ‘b$ = “email body”’ can i also link it to a text field?
how can i do this?

thank you

Hello, This is possible though a basic script in the ViewOn project. Here is a screen shot of a script i wrote. In this example i grabbed a string and saved it to a email variable. This script is executed when you hit enter. Then in Basic i have an onChange event that uses the string.

Thank you verry much!