Sending emails with LiveCode
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 23
- Joined: Wed Oct 31, 2007 9:16 pm
Sending emails with LiveCode
I'm stuck!
At first I set up and was very successful sending emails from my standalone using the on-rev.com server that is my host (following these instructions: http://lessons.runrev.com/s/lessons/m/4 ... er-scripts). The problem that I hit is that, once again, the on-rev.com server has stopped sending ALL emails (for wordpress, photocart, machforms and other applications I have running on there as well as anything form my own .lc code that processes emails created in my standalone). I've submitted a support request for this problem but am still waiting. This happened about a year ago and eventually they got it fixed (not sure how or I'd suggest it to them again!), however this time around it's not just my activities that are being affected (wordpress, photocart, etc., were all sending emails to me notifying me of things as people interacted with my websites hosted on on-rev.com), but now I have a client using the stand-alone that needs to process emails and it's not working for her...which is a BIG issue! Since this has happened in the past and each time it happens there is no warning (you think you've sent the emails until people start complaining that they never got them), I do not want to rely on this for a client.
So I began to look into other ways of doing it.
1. I tried just using the revMail command, but that doesn't work for the message of the email as she needs to be able to send html emails (they have a table in them displaying the dancers' account charges, credits and balance - the stand alone is for a dance studio).
2. So then I found the instructions for using Thunderbird (which she DOES use, so bonus there!) (http://lessons.runrev.com/s/lessons/m/4 ... tml-e-mail) and it works beautifully for sending ONE email - and only if Thunderbird has been shut down prior to attempting to send that email. If I try to send multiple (the way the stand alone works is that she can select various groupings of dancers and click a button to "send account statements" and it processes and creates the email for each dancer's account), it will open the first one and then for each subsequent one I get a pop-up saying "only one Thunderbird may be open at a time." I also get this pop-up if I try to send one without first closing out the Thunderbird app (highly irritating as many people, including my client, leave their email app open all the time).
So, to sum up...
Sending multiple html emails through the server worked until my server quit doing it.
And then sending multiple emails through revMail command worked except that I need them to be html.
And finally sending html emails through Thunderbird worked except for when Thunderbird is already open and when I need to send more than one at a time (which is often!)
HELP PLEASE!
THANKS!!
At first I set up and was very successful sending emails from my standalone using the on-rev.com server that is my host (following these instructions: http://lessons.runrev.com/s/lessons/m/4 ... er-scripts). The problem that I hit is that, once again, the on-rev.com server has stopped sending ALL emails (for wordpress, photocart, machforms and other applications I have running on there as well as anything form my own .lc code that processes emails created in my standalone). I've submitted a support request for this problem but am still waiting. This happened about a year ago and eventually they got it fixed (not sure how or I'd suggest it to them again!), however this time around it's not just my activities that are being affected (wordpress, photocart, etc., were all sending emails to me notifying me of things as people interacted with my websites hosted on on-rev.com), but now I have a client using the stand-alone that needs to process emails and it's not working for her...which is a BIG issue! Since this has happened in the past and each time it happens there is no warning (you think you've sent the emails until people start complaining that they never got them), I do not want to rely on this for a client.
So I began to look into other ways of doing it.
1. I tried just using the revMail command, but that doesn't work for the message of the email as she needs to be able to send html emails (they have a table in them displaying the dancers' account charges, credits and balance - the stand alone is for a dance studio).
2. So then I found the instructions for using Thunderbird (which she DOES use, so bonus there!) (http://lessons.runrev.com/s/lessons/m/4 ... tml-e-mail) and it works beautifully for sending ONE email - and only if Thunderbird has been shut down prior to attempting to send that email. If I try to send multiple (the way the stand alone works is that she can select various groupings of dancers and click a button to "send account statements" and it processes and creates the email for each dancer's account), it will open the first one and then for each subsequent one I get a pop-up saying "only one Thunderbird may be open at a time." I also get this pop-up if I try to send one without first closing out the Thunderbird app (highly irritating as many people, including my client, leave their email app open all the time).
So, to sum up...
Sending multiple html emails through the server worked until my server quit doing it.
And then sending multiple emails through revMail command worked except that I need them to be html.
And finally sending html emails through Thunderbird worked except for when Thunderbird is already open and when I need to send more than one at a time (which is often!)
HELP PLEASE!
THANKS!!
Re: Sending emails with LiveCode
Hi,
Which operating system do you use?
Kind regards,
Mark
Which operating system do you use?
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 23
- Joined: Wed Oct 31, 2007 9:16 pm
Re: Sending emails with LiveCode
I use OSX to code but my dance studio client uses Windows and the mobile apps I've built are on iOS and Android
Re: Sending emails with LiveCode
Hi,
I have tried the code from the "lesson". It works fine on Windows 8, except for the part that launches Thunderbird. I have to adjust the path to the executable.
I have the following code in field 2:
When I run this script, it creates a new e-mail, regardless of whether Thunderbird is running or not, and sends it automatically. Note that in my script, I replaced the fields at the start of the mouseUp handler with strings. You'll have to change that. You can do this in a repeat loop as well. For example if you have a list with e-mails you can do something like:
If this doesn't work on your client's computer, maybe she needs to update Thunderbird or buy a new computer
I have tried the code from the "lesson". It works fine on Windows 8, except for the part that launches Thunderbird. I have to adjust the path to the executable.
Code: Select all
on mouseUp
# declare the variable that holds the launch string
local lvLaunchString
# populate the launch string with data from the user interface
put empty into lvLaunchString
populateLaunchString lvLaunchString, "to=", "test@test.xyz"
populateLaunchString lvLaunchString, "cc=", "test@test.xyz"
populateLaunchString lvLaunchString, "subject=", "Test Subject"
populateLaunchString lvLaunchString, "body=", the htmlText of field "Body Field"
# populate the launch string with platform specific information for thunderbird
if the platform is "MacOS" then # we are on a Mac
put "/Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin -compose" && lvLaunchString into lvLaunchString
else if the platform is "Win32" then # we are on Windows
if the systemVersion is "NT 6.2" then
put "c:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe -compose" && lvLaunchString into lvLaunchString
else
put "c:\Program Files\Mozilla Thunderbird\thunderbird.exe -compose" && lvLaunchString into lvLaunchString
end if
else # we do not support this platform
exit to top
end if
# launch the thunderbird compose window
set the hideConsoleWindows to true
open process lvLaunchString for update
close process lvLaunchString
wait 1 second with messages
do fld 2 as VBScript
end mouseUp
# assemble tokens and arguments into the launch string
command populateLaunchString @pLaunchString avToken avArgument
if avArgument is empty then exit populateLaunchString
if pLaunchString is not empty then put pLaunchString & "," into pLaunchString
put pLaunchString & avToken & "'" & avArgument & "'" into pLaunchString
end populateLaunchString
Code: Select all
dim sendKeyObj
Set sendKeyObj = CreateObject("WScript.Shell")
sendKeyObj.SendKeys "^{ENTER}"
Code: Select all
repeat for each line myAddress in myEMailList with messages
populateLaunchString lvLaunchString, "to=", myAddress
populateLaunchString lvLaunchString, "subject=", "Test Subject"
populateLaunchString lvLaunchString, "body=", the htmlText of field "Body Field"
-- remainder of script here
wait 0 millisecs with messages
end repeat
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Sending emails with LiveCode
Hey mark,
You said the script creates AND sends the mail automatically. I,however cannot seem to make it send automatically?
The creating of the mail itself works like a charm but the sending-part does not work for me.
Got any tips on how to make those work?
Thanks!
You said the script creates AND sends the mail automatically. I,however cannot seem to make it send automatically?
The creating of the mail itself works like a charm but the sending-part does not work for me.
Got any tips on how to make those work?
Thanks!
-
- VIP Livecode Opensource Backer
- Posts: 190
- Joined: Sat Apr 08, 2006 7:55 am
- Location: Lübbecke, Germany
- Contact:
Re: Sending emails with LiveCode
Hi Zood,
if you are using a commercial license of LC, like Indy or Business, then you could use the tsNET external for sending out emails.
I´ve uploaded a sample stack which shows basic email and ftp functions using the tsNet.
https://dl.qck.nu/?dl=lcMailAndFTP.livecode
Regards,
Matthias
if you are using a commercial license of LC, like Indy or Business, then you could use the tsNET external for sending out emails.
I´ve uploaded a sample stack which shows basic email and ftp functions using the tsNet.
https://dl.qck.nu/?dl=lcMailAndFTP.livecode
Regards,
Matthias
Re: Sending emails with LiveCode
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!