Author Topic: Send an e-mail with a click of a button  (Read 7345 times)

zero1080

  • Newbie
  • *
  • Posts: 2
Send an e-mail with a click of a button
« 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? 

Malkom

  • Administrator
  • Newbie
  • *****
  • Posts: 464
  • Here to help you
Re: Send an e-mail with a click of a button
« Reply #1 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

« Last Edit: November 11, 2020, 02:20:47 PM by Malkom »
I am sorry but I do not have time to answer questions by PM or email.
If you post your questions in this forum then it might help others.

zero1080

  • Newbie
  • *
  • Posts: 2
Re: Send an e-mail with a click of a button
« Reply #2 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.