Page 1 of 1

STMP

Posted: Tue May 07, 2019 1:53 am
by Quinton B.
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.

Re: STMP

Posted: Tue May 07, 2019 8:53 am
by SparkOut
Sarah Reichelt's blog explains it here:
https://troz.net/post/2015/livecode-stacks/ and includes a link to archived LiveCode stacks on github.

Re: STMP

Posted: Sun Sep 15, 2019 10:19 pm
by Quinton B.
Lol, I'm still having trouble with this, Sarah's doesn;t work either.

Re: STMP

Posted: Sun Sep 15, 2019 10:54 pm
by Klaus
Hi Quinton,

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


Best

Klaus

Re: STMP

Posted: Mon Sep 23, 2019 1:41 am
by Quinton B.
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