Matthias,

The roll is finished for the day ;-)

However, adding multiple attachments simply means changing the "if" statement on line 110 of the button "Send Email" script to a for loop, and sending an array of files/file contents to the createSmtpMessage function instead. Feel free to have a go at that if you like - otherwise I can update it in a day or two.

There is one other issue related to attachments, and that is that it currently only supports attaching PDF documents. This is because on line 112 of the button "Send Email" script (within that "if" statement), I have hard-coded the "Content-Type" of the attachment that is sent with the following code:

*put*"Content-Type: application/pdf;"& craftertPostData

This needs to be changed so that the script automatically detects the type of attachment that is selected and adds the appropriate Content-Type header for each attachment. The most basic form of doing file type detection would be to use the file extension to determine its type. Obviously that would not be 100% accurate though.

For some applications, the type of attachment might be known in advance.

Cheers,

Charles


On 17/09/2016 6:56 PM, Matthias Rebbe wrote:
Hi Charles,

if you are still on the roll, the only thing that is now still missing is the 
handling of multiple attachments.  ;)

Regards,

Matthias


Am 17.09.2016 um 10:43 schrieb Matthias Rebbe 
<matthias_livecode_150...@m-r-d.de>:

Keep rolling, Charles, keep rolling! ;)


Am 17.09.2016 um 10:29 schrieb Charles Warwick <char...@techstrategies.com.au 
<mailto:char...@techstrategies.com.au>>:

Since I was on a roll, I decided to add HTML support to it as well.

Updated version now available at the same URL.


On 17/09/2016 6:10 PM, Matthias Rebbe wrote:
Hi Charles,


Am 17.09.2016 um 09:52 schrieb Charles Warwick <char...@techstrategies.com.au 
<mailto:char...@techstrategies.com.au>>:

The tsNetSmtp* functions can take multiple e-mail addresses in a single call, 
just ensure the tRecipient variable has one address per line.

Oh, thats brilliant. Much easier than doing a call for every address.
So one can add To, CC and Bcc recipients  into one variable.


As Matthias said, you also need to add the To: and Cc: headers accordingly.

I have updated the LCMail.livecode stack to show an example:

https://downloads.techstrategies.com.au/tsnet/LCMail.livecode 
<https://downloads.techstrategies.com.au/tsnet/LCMail.livecode><https://downloads.techstrategies.com.au/tsnet/LCMail.livecode
 <https://downloads.techstrategies.com.au/tsnet/LCMail.livecode>>

... and I will try make the documentation a bit clearer :-)

@Matthias: sorry, I made these changes before I saw you had updated your stack! 
 Otherwise I would have made these changes to a copy of your stack instead.
Never mind. If i find the time today i will add your modifications to my stack 
and send it afterwards directly to you, if you donĀ“t mind.

Matthias

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com <mailto:use-livecode@lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode 
<http://lists.runrev.com/mailman/listinfo/use-livecode>
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to