Sending email in livecode

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
M.K.
Posts: 1
Joined: Sun Nov 03, 2013 7:13 am

Sending email in livecode

Post by M.K. » Sun Nov 03, 2013 7:26 am

i am trying to Build a program that will send a default email to an email address , The receiver address will be taken from a text field , and the sender address , subject , message will be provided on the code .

I tried this code and i got a problem when it get to "get shell("echo" && wrapQ(shellEscape(tMsg)) && "| /usr/sbin/sendmail" && "

The button send :

Code: Select all

on mouseUp
    local tMsg
    put "Been checked" into tMsg
    put "User2@???????" into pFrom
    put the text of field "emailtext" into pTo
    put "Checked" into pSub
    put "Been checked" into tMsg
    put "Checked" into pSub
    put "From:" && pFrom & return & "To:" && pTo & return & "Subject:" && pSub & \
    return into tMsg    
    get shell("echo" && wrapQ(shellEscape(tMsg)) && "| /usr/sbin/sendmail" && \
    wrapQ(shellEscape(pTo)) && "-f" && wrapQ(shellEscape(pFrom)))
     send mail
      end mouseUp

chris25
Posts: 354
Joined: Tue Oct 08, 2013 9:32 pm

Re: Sending email in livecode

Post by chris25 » Sun Nov 03, 2013 10:49 am

At the risk of putting my foot in it BIG time,

and I feel like I am interupting a conversation right now, but have a quick question for you. I went to this shell command and noticed that it only applies to OSX and Linux servers. ? The only reason I am asking is because today I will be looking at how to configure a link so that the users email box opens and addresses an email to me, and then, yes then :D I saw your question.....
Kind regards
chris

....ten minutes later....mine was easier just found it, "revmail'. That was quick. Sorry to have bothered you....have a nice day

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Sending email in livecode

Post by jacque » Sun Nov 03, 2013 7:48 pm

As Chris found, you're better off using revMail if you're writing for a desktop app. It's in the dictionary.

The shell command is used mostly with LiveCode server. Is that what you're using? If so, the wrapQ function is a custom function that is probably located somewhere else in the example script you found.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply