HyperNext Studio

HyperNext Studio => Networks => Topic started by: zero1080 on November 10, 2020, 11:21:13 AM

Title: Send an e-mail with a click of a button
Post by: zero1080 on November 10, 2020, 11:21:13 AM
Hello guys, new to programming, i have just created my interface which includes a picture canvas and a single button. I want, when someone clicks the button an e-mail with subject "TEST" and message "It's me!" to be sent to a specific recipient. How can i make it work? 
Title: Re: Send an e-mail with a click of a button
Post by: Malkom on November 11, 2020, 11:25:30 AM
Hello guys, new to programming, i have just created my interface which includes a picture canvas and a single button. I want, when someone clicks the button an e-mail with subject "TEST" and message "It's me!" to be sent to a specific recipient. How can i make it work?

Hello,

Below is a script that you can place in your button to send an email. Note, it requires a field on the card where it can place the result, either 0 for fail, or 1 for sent.

By the way, the script does not work with my web host because they are very security conscious and do not allow port 25 to be used.
They mandate port 587 with START TLS security that HN does not support.

However, if your web host allows port 25, or 587 without the extra security, then the script should work.


Code: [Select]
Local port,server,username,password
Local res


Put 25 into port
Put 'mail.yourdomain.com' into server
Put 'name@yourdomain.com' into username
Put '123456789' into password

EmailSetServer(port,server,username,password)

EmailCreateNew

EmailSetFrom(username)

EmailSetTo('friend@somedomain.com')

EmailSetSubject('TEST')

EmailSetBodyPlain('It's me!')


Put EmailSendFN(600) into res
Put res into field 1

Title: Re: Send an e-mail with a click of a button
Post by: zero1080 on November 13, 2020, 01:15:52 PM
Many thanks Malkom, i will give it a try and let you know if i need more help.