STMP

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

STMP

Post by Quinton B. » Tue May 07, 2019 1:53 am

Good evening,
I'm trying to send an email through my app in the background.
I've found this: viewtopic.php?f=7&t=4835&p=77979&hilit=stmp#p77979 but the links are all dead.

SparkOut
Posts: 2852
Joined: Sun Sep 23, 2007 4:58 pm

Re: STMP

Post by SparkOut » Tue May 07, 2019 8:53 am

Sarah Reichelt's blog explains it here:
https://troz.net/post/2015/livecode-stacks/ and includes a link to archived LiveCode stacks on github.

Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Re: STMP

Post by Quinton B. » Sun Sep 15, 2019 10:19 pm

Lol, I'm still having trouble with this, Sarah's doesn;t work either.

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: STMP

Post by Klaus » Sun Sep 15, 2019 10:54 pm

Hi Quinton,

did you see this one:
http://lessons.livecode.com/m/4071/l/68 ... t-external


Best

Klaus

Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Re: STMP

Post by Quinton B. » Mon Sep 23, 2019 1:41 am

Yes, however it doesn't work.

xx are for codes that will not be in here.

Code: Select all

on sendVerificationCode
   local tUrl, tEmailMessage, tSender, tRecipient, tSettings, tResult, tBytes, tResponseHeaders
   
   put "smtp://mail.portableairman.com:xxx/" into tUrl
   put  "Your Portable Airman Authentication Code is:" & tRandomAlphaNumericalGenerator  into tEmailMessage
   
   put "do_not_reply@portableairman.com" into tSettings["username"]
   put "xxxxxxxxxxxxxxxx" into tSettings["password"]
   put "do_not_reply@portableairman.com" into tSender
   put tDoDEmailCheck into tRecipient
 
   
   -- Enable TLS for SMTP
   put true into tSettings["use_ssl"]
   
   put tsNetSmtpSync(tURL, tSender, tRecipient, tEmailMessage, tResponseHeaders, tBytes, tSettings) into tResult  
   
   if the first word of tResult is "tsneterr:" then
      answer "Error" && tResult && "returned from server"
   else
      answer "E-mail sent"
   end if
   go to card "Verification"
end sendVerificationCode

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”