eMail attachment: best practice?

matthias_livecode_150811 at m-r-d.de matthias_livecode_150811 at m-r-d.de
Wed Jun 26 17:25:09 EDT 2024


Von meinem iPad gesendet

> Am 26.06.2024 um 15:01 schrieb Paul Dupuis via use-livecode <use-livecode at lists.runrev.com>:
> 
> So this tsNet example for sending an email look great IF you are using it in an corporate or institutional setting. One where you have a known SMTP server and you know whether or not that SMTP server requires authentication.


> However, in the "wild" of a distributed application that could be on any customer's computer in any setting, how do you know what the customer's SMTP server is or whether it requires authentication. If it does require authentication, most people set

Your app needs to have a card or substack where the customers can add their mail account login data and the server ip or name and all the other information they would enter when adding an email account to their e-mail client.  


> this up in their email client ONCE (or rarely) and may not know or remember what the credentials are.
> 
Those people would also run into trouble if they switch to another e-mail client or if they get a new computer where they have to setup the e-mail client again.
This is not an email problem per se, but rather the problem that users are not doing proper password management.

> So I considered using our company SMTP server, but increasingly, SMTP servers will reject messages if they are from a client computer that is not in the same domain, as is the case with ours (for anti-spamming/spoofing), so that it out as an option.
> 
What exactly did you want to do?
Use the server to send e-mails  to internal accounts on that server?

Or did you want to use that server as a relay server to send emails to external e-mail addresses? To do that you normally need an e-mail account on that server and your account needs to have the right to send external e-mails and you need to have to authenticate on that server when sending the e-mails to external users.


> I kinda need a solution that uses the clients own email client (and server).
tsNet behaves like an e-mail client. If the customer now there e-mail credentials and other information for setting up an e-mail client and if your app allows to enter those information, then tsNet will work without a problem.
Maybe with one exception. If the server only allows 2FA for the e-mail clients, then tsNet needs to support this. Maybe this is already the case, maybe not.
This is a question Charles Warwick or Livecode Support could answer


> Maybe I should look at how to encode the array in a pure text form that can be part of the email body and send it that way. The problem there is that some email clients (like gMail) limit the size of the message body that can be generated from their APIs. If you use revMail with someone with gMail as their default mail, the message body can only be about 2500 characters (or maybe 5000, I forget the exact limit).
> 
> I suppose I could output the array as an encoded file to the customer's desktop and ASK them to manually attach it to the generated email? I wish there was a better option.
> 
> 
>> On 6/25/2024 6:15 PM, matthias rebbe via use-livecode wrote:
>> Instead of using revMail which opens the default mail client app you could use tsNET external, which is availlable  for Win/Mac/Linux/iOS and Android.
>> 
>> The only thing you have to keep in mind is that tsNet directly sends the email instead of opening the default email client.
>> 
>> Here you can find an sample stack
>> https://downloads.techstrategies.com.au/tsnet/smtpexample.livecode
>> 
>> And here is a link to a Livecode Lesson
>> https://lessons.livecode.com/m/4071/l/685661-how-to-send-e-mail-using-the-tsnet-external
>> 
>> 
>> 
>>>> Am 25.06.2024 um 22:35 schrieb Paul Dupuis via use-livecode <use-livecode at lists.runrev.com>:
>>> 
>>> Under a specific condition, my app creates an email with some pre-populated information using revMail:
>>> 
>>> revMail address, [ccAddress, [mailSubject, [messageBody]]]
>>> 
>>> So, my call is: revMail tSupportEmail, , "Diagnostic Report Information", tEmailBody
>>> Where tSupportEmail contains a valid email address and tEmailBody contain the information I want to send.
>>> 
>>> I realize the user still has to click their send button in their email client, but I have 2 questions:
>>> 
>>> 1) I see the Dictionary still lists "revMailUnicode" with the same parameters. If tEmailBody contains Unicode characters do I need to textEncode(tEmailBody, "UTF-16") and use revMailUnicode OR is plain old revMail now Unicode aware
>>> 
>>> 2) My more important question is how does one create an email with an attached file? I see no feature of revMail to include an attachment. Is there some other way? If there is no way to add an attachment, what might the best practice for sending the contents and structure of a Livecode array be?
>>> 
>>> 
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at 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 at 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 at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list