Sending an email with a file attachment
Richard Gaskin
ambassador at fourthworld.com
Fri Sep 14 11:13:05 EDT 2012
Warren Samples wrote:
> On 09/14/2012 08:13 AM, Richard Gaskin wrote:
>> Maybe I'm coming in late to this thread, but if the body of the email is
>> less than 1k have you considered just sending it along as a param in the
>> url?:
>>
>> on mouseUp
>> put "someone at somewhere.com" into tAddress
>> put "Hello!" into tSubject
>> put "This is the body"&cr&"of the email." into tBody
>> put "mailto:"& tAddress & "?" \
>> & "subject="& tSubject &"&" \
>> & "body="& tBody into tEmailURL
>> launch url tEmailURL
>> end mouseUp
...
> This script causes unexpected problems here. It launches KMail on my
> system despite my having Thunderbird properly set as the default system
> email client. What happens if no desktop client is being used? (I
> honestly don't know, I have never been one of those people who use
> web-based mail.) Can one be assured that that behavior will be
> consistent? A second problem on my system, running Linux, is that the
> body is not inserted into the message. This seems to be related to the
> number of parameters the system will pass to the email client. It
> accepts only two, apparently. So, recipient's address + (pick one: cc,
> subject OR body). revMail also behaves exactly this way here.
Those are all good points, but I suspect there would be even more issues
trying to get consistent behavior with managing the OS mechanism for
copy-and-paste into email clients on all those platforms.
Probably the most reliable method would be to write a quick CGI to
receive the data, and have the dialog stack post it there over HTTP.
That seems to be how this sort of thing is handled most often.
--
Richard Gaskin
Fourth World
LiveCode training and consulting: http://www.fourthworld.com
Webzine for LiveCode developers: http://www.LiveCodeJournal.com
Follow me on Twitter: http://twitter.com/FourthWorldSys
More information about the use-livecode
mailing list