[tsNet] tsNetSmtpSync

Thierry Douez th.douez at gmail.com
Fri Sep 15 05:08:02 EDT 2017


2017-09-15 10:57 GMT+02:00 Charles Warwick

Hi Thierry,
>
> On 15/09/2017 6:31 PM, Thierry Douez:
>
>> Hi all,
>>
>> I've worked hard with tsNetSmtpSync() these last days,
>> on macOS Sierra with the latest LC 8.1.6
>> and have 2 questions which bothers me:
>>
>> - from time to time (no recipe yet), I've got an error when executing it.
>> Executing it again (same code and context) and all is fine then.
>>
>
> What is the error message that you get?




​Mmm, of course,  I should have read the error number :)
Will post back with other tests a bit later...
​

>
>
> - about the ResponseHeaders out parameter:
>>
> tsNet will try re-use an existing connection if there is one available, so
> this first example:
>
> Sometimes I get:
>>
>> 220-xxx.yyyy.net ESMTP Exim 4.89 #1 Thu, 14 Sep 2017 14:17:38 +0200
>> 220-We do not authorize the use of this system to transport unsolicited,
>> 220
>> ​........
>>
>> 250 OK id=1dsT5O-002hrt-TA
>>
>

> Indicates that there was no existing SMTP connection to the server, so it
> needed to establish a new connection.
>
> Where in the following example:
>>
>> 250 OK
>> 250 Accepted
>> 250 Accepted
>> 354 Enter message, ending with "." on a line by itself
>> 250 OK id=1dsSmD-003WQr-2l
>>
>

> This indicates that tsNet found an existing SMTP connection to the server
> you are connecting to, so could just send the message across the already
> open connection. ​

You can add the "no_reuse" element with a value of true to the settings
> array (last parameter to tsNetSmtpSync) if you want to establish a fresh
> connection for each e-mail that is sent rather than allowing tsNet to reuse
> an existing connection.
>

​I guess both methods are safe?
or is there some advantages with one or the other?

I'm using it within a Livecode Mail Composer.
Based on an export of my server DB, I'm scanning some address,
build dynamically the html-email and send one by one all emails.
​

>
> Hope that helps,
>


​Thanks Charles for your  explanations, much appreciated.


Regards,

Thierry



> In both cases, the email is sent and received correctly.
>>
>> Thanks for some hints.
>>
>> Thierry
>>
>>
-- 
------------------------------------------------
Thierry Douez - sunny-tdz.com
sunnYrex - sunnYtext2speech - sunnYperl - sunnYmidi - sunnYmage



More information about the use-livecode mailing list