Re: tsNet mail message not formatting

2021-03-05 Thread J. Landman Gay via use-livecode

On 3/3/21 6:00 PM, Bob Sneidar via use-livecode wrote:

Still sketchy on whether or not open file for binary write and put url binfile 
give the same results.


Yes, they do the same thing.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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


Re: tsNet mail message not formatting

2021-03-03 Thread J. Landman Gay via use-livecode

I once inherited a stack where the original developer did just that.
--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On March 3, 2021 5:46:06 PM Bob Sneidar via use-livecode 
 wrote:


That answers my question. Actually, I have no idea why I don’t ALWAYS use 
open file for binary.




___
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


Re: tsNet mail message not formatting

2021-03-03 Thread Rick Harrison via use-livecode
Hi Charles,

I had almost everything right.
I was missing a cr between tCc and tBcc.  Oops.

Everything is working great now!

Thanks!!!

Rick

> On Mar 3, 2021, at 6:48 PM, Charles Warwick via use-livecode 
>  wrote:
> 
> Hi Rick,
> 
> What code did you try to add the Bcc e-mail recipients?
> 
> The tRecipient variable to the tsNetSmtpSync command needs to be one e-mail 
> address per line of all the recipients for the e-mail (To, Cc and Bcc) and 
> that is what is used to determine who the e-mail is sent to.
> 
> The rest of that script (in the lesson) is about how to format the e-mail 
> message, Bcc addresses don't get added to the header of the e-mail message.
> 
> So assuming your Bcc's addresses are stored in a variable called tBcc (one 
> per line), then you need to simply adjust the script (from the lesson) as 
> follows:
> 
> -- Make tRecipient a list of all recipients (To, Cc and Bcc)
> put tTo & cr & tCc & cr & tBcc into tRecipient 
> 
> put tsNetSmtpSync(tUrl, tFrom, tRecipient, tEmailMessage, tResponseHeaders, 
> tBytes, tSettings) into tResult
> 
> Regards,
> 
> Charles


___
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


Re: tsNet mail message not formatting

2021-03-03 Thread matthias rebbe via use-livecode
Thanks Charles,

-
Matthias Rebbe
Life Is Too Short For Boring Code

this might is a relic from  times before tsNET.  When i started with tsNet i 
modified existing code and maybe i kept this "bad" behaviour. ;)

I used this only for inhouse status and alert emails for up to 5 recipients and 
never ran into a problem.

But i will keep it in mind for future use.



> Am 04.03.2021 um 00:48 schrieb Charles Warwick via use-livecode 
> :
> 
> Hi Matthias,
> 
> I would not recommend sending e-mail this way.  It will create a new SMTP 
> connection and send the e-mail message separately for every single recipient.
> 
> SMTP connections (and tsNetSMTP* commands) are designed to handle multiple 
> recipients for one e-mail within a single SMTP transfer.
> 
> Regards,
> 
> Charles
> 
>> On 4 Mar 2021, at 9:30 am, matthias rebbe via use-livecode 
>> mailto:use-livecode@lists.runrev.com>> wrote:
>> 
>> Rick,
>> 
>> let's say
>> 
>> pTO contains one or more email recipients, each in one line
>> pCC contains one or mor  cc recipients, each in one line
>> pBCC contains one or more bcc recipients, each in one line
>> tData contains the mime encoded message which includes all To and all CC 
>> recipients
>> 
>> then you would do
>> 
>> 
>> repeat for each line tLine in pTO
>> put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
>> tSettings)
>> end repeat
>> 
>> repeat for each line tLine in pCC
>> put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
>> tSettings)
>> end repeat
>> 
>> repeat for each line tLine in pBCC
>> put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
>> tSettings)
>> end repeat
>> 
>> The last repeat sends to the BCC recipients.
>> 
>> 
>> 
>> -
>> Matthias Rebbe
>> Life Is Too Short For Boring Code
>> 
>>> Am 03.03.2021 um 23:19 schrieb Rick Harrison via use-livecode 
>>> mailto:use-livecode@lists.runrev.com>>:
>>> Ok, everything is fine on the format front now.
>>> I noticed the code takes about a minute to execute all the way through.
>>> (Must be a lot of background process have to run?)
>>> I tried Charles Warwick’s suggestion for Bcc, and it didn’t work. :-(
>>> If any of you want to take a crack at it, please let me know your results.
>>> Thanks to everyone!
>>> Rick
>>> ___
>>> 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 
> 
___
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


Re: tsNet mail message not formatting

2021-03-03 Thread Bob Sneidar via use-livecode
Still sketchy on whether or not open file for binary write and put url binfile 
give the same results.

Bob S


On Mar 3, 2021, at 3:56 PM, Brian Milby via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Correct.  So the current situation requires you to use binfile for Mac/Linux 
and file for Windows/Linux to get appropriate line endings.  You can’t do it 
just one way, you have to check your OS.  Notice that Linux works both ways.

(You also should encode/decode if using binfile)

In ScriptTracker I use file for import since it handles everything and then let 
the user choose method for export (binfile would work fine for GitHub and Atom 
even on Windows).  Now that I think about it I could even add a “native” option 
that would use file for Windows and binfile otherwise.

Sent from my iPhone

___
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


Re: tsNet mail message not formatting

2021-03-03 Thread Brian Milby via use-livecode
Correct.  So the current situation requires you to use binfile for Mac/Linux 
and file for Windows/Linux to get appropriate line endings.  You can’t do it 
just one way, you have to check your OS.  Notice that Linux works both ways.

(You also should encode/decode if using binfile)

In ScriptTracker I use file for import since it handles everything and then let 
the user choose method for export (binfile would work fine for GitHub and Atom 
even on Windows).  Now that I think about it I could even add a “native” option 
that would use file for Windows and binfile otherwise.

Sent from my iPhone

> On Mar 3, 2021, at 4:37 PM, J. Landman Gay via use-livecode 
>  wrote:
> 
> On 3/3/21 1:51 PM, Brian Milby via use-livecode wrote:
>> If you want to be the most accurate (clear for others reading code) you 
>> would use the LF constant instead of CR since that is how it actually 
>> evaluates.  The only way to generate an actual CR within code is to use CRLF 
>> (which gets both) or use numtobyte(13).
>> If you export as text, then you get what is expected on Win/Linux and get CR 
>> on Mac (which is wrong in my opinion).
> 
> On the other hand, if you export text as binary you get whatever you wrote, 
> and automatic line endings aren't converted.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
> 
> ___
> 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


Re: tsNet mail message not formatting

2021-03-03 Thread Charles Warwick via use-livecode
Hi Rick,

What code did you try to add the Bcc e-mail recipients?

The tRecipient variable to the tsNetSmtpSync command needs to be one e-mail 
address per line of all the recipients for the e-mail (To, Cc and Bcc) and that 
is what is used to determine who the e-mail is sent to.

The rest of that script (in the lesson) is about how to format the e-mail 
message, Bcc addresses don't get added to the header of the e-mail message.

So assuming your Bcc's addresses are stored in a variable called tBcc (one per 
line), then you need to simply adjust the script (from the lesson) as follows:

-- Make tRecipient a list of all recipients (To, Cc and Bcc)
put tTo & cr & tCc & cr & tBcc into tRecipient 

put tsNetSmtpSync(tUrl, tFrom, tRecipient, tEmailMessage, tResponseHeaders, 
tBytes, tSettings) into tResult

Regards,

Charles

> On 4 Mar 2021, at 9:20 am, Rick Harrison via use-livecode 
>  wrote:
> 
> Ok, everything is fine on the format front now.
> 
> I noticed the code takes about a minute to execute all the way through.
> (Must be a lot of background process have to run?)
> 
> I tried Charles Warwick’s suggestion for Bcc, and it didn’t work. :-(
> If any of you want to take a crack at it, please let me know your results.
> 
> Thanks to everyone!
> 
> Rick
> ___
> 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


Re: tsNet mail message not formatting

2021-03-03 Thread Charles Warwick via use-livecode
Hi Matthias,

I would not recommend sending e-mail this way.  It will create a new SMTP 
connection and send the e-mail message separately for every single recipient.

SMTP connections (and tsNetSMTP* commands) are designed to handle multiple 
recipients for one e-mail within a single SMTP transfer.

Regards,

Charles

> On 4 Mar 2021, at 9:30 am, matthias rebbe via use-livecode 
>  wrote:
> 
> Rick,
> 
> let's say
> 
> pTO contains one or more email recipients, each in one line
> pCC contains one or mor  cc recipients, each in one line
> pBCC contains one or more bcc recipients, each in one line
> tData contains the mime encoded message which includes all To and all CC 
> recipients
> 
> then you would do
> 
> 
> repeat for each line tLine in pTO
> put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
> tSettings)
> end repeat
> 
> repeat for each line tLine in pCC
> put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
> tSettings)
> end repeat
> 
> repeat for each line tLine in pBCC
> put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
> tSettings)
> end repeat
> 
> The last repeat sends to the BCC recipients.
> 
> 
> 
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
> 
>> Am 03.03.2021 um 23:19 schrieb Rick Harrison via use-livecode 
>> :
>> Ok, everything is fine on the format front now.
>> I noticed the code takes about a minute to execute all the way through.
>> (Must be a lot of background process have to run?)
>> I tried Charles Warwick’s suggestion for Bcc, and it didn’t work. :-(
>> If any of you want to take a crack at it, please let me know your results.
>> Thanks to everyone!
>> Rick
>> ___
>> 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


Re: tsNet mail message not formatting

2021-03-03 Thread Bob Sneidar via use-livecode
That answers my question. Actually, I have no idea why I don’t ALWAYS use open 
file for binary.

Bob S


On Mar 3, 2021, at 2:36 PM, J. Landman Gay via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

On 3/3/21 1:51 PM, Brian Milby via use-livecode wrote:
If you want to be the most accurate (clear for others reading code) you would 
use the LF constant instead of CR since that is how it actually evaluates.  The 
only way to generate an actual CR within code is to use CRLF (which gets both) 
or use numtobyte(13).
If you export as text, then you get what is expected on Win/Linux and get CR on 
Mac (which is wrong in my opinion).

On the other hand, if you export text as binary you get whatever you wrote, and 
automatic line endings aren't converted.

--
Jacqueline Landman Gay

___
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


Re: tsNet mail message not formatting

2021-03-03 Thread Bob Sneidar via use-livecode
Thanks Matthias. Actually I use open file and write to file, but the results 
may be the same. Are you saying if use open binary file it will not translate 
the line endings?

Bob S


On Mar 3, 2021, at 1:51 PM, matthias rebbe via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

The problem is,  put URL file:  uses the line endings of the os where the it is 
executed, even if you have a container/variable with some text and line endings 
CRLF. As soon as you use put  into URL "file:..." the line endings are 
converted to the default ones of the os where the code is excecuted. In case of 
macOS the line endings are converted from CRLF to CR.

If you want to keep the CRLF line endings on macOS then you have to use put 
 into URL "binfile:..."  In this case the written data keeps the line 
endings you used when "filling" the container/variable.




-
Matthias Rebbe
Life Is Too Short For Boring Code

Am 03.03.2021 um 22:43 schrieb Bob Sneidar via use-livecode 
mailto:use-livecode@lists.runrev.com>>:

OK Now I am interested. I have a little utility that converts a Konica Minolta 
address book to a Toshiba one. If I run the utility on a Mac, the address book 
will not import into a Toshiba copier, but if I first OPEN the csv file in 
WINDOWS, then save and close it, suddenly it WILL import. I tracked this down 
some time ago to the fact that the line endings were different than the Toshiba 
was expecting. I thought I fixed it by using LF but I have the same problem as 
before. From what I am reading, the LC constants will return a different result 
on LC for Windows as opposed to LC for Mac??

Bob S

___
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


Re: tsNet mail message not formatting

2021-03-03 Thread J. Landman Gay via use-livecode

On 3/3/21 1:51 PM, Brian Milby via use-livecode wrote:

If you want to be the most accurate (clear for others reading code) you would 
use the LF constant instead of CR since that is how it actually evaluates.  The 
only way to generate an actual CR within code is to use CRLF (which gets both) 
or use numtobyte(13).

If you export as text, then you get what is expected on Win/Linux and get CR on 
Mac (which is wrong in my opinion).


On the other hand, if you export text as binary you get whatever you wrote, and automatic line 
endings aren't converted.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
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


Re: tsNet mail message not formatting

2021-03-03 Thread matthias rebbe via use-livecode
Rick,

let's say

pTO contains one or more email recipients, each in one line
pCC contains one or mor  cc recipients, each in one line
pBCC contains one or more bcc recipients, each in one line
tData contains the mime encoded message which includes all To and all CC 
recipients

then you would do


repeat for each line tLine in pTO
  put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
tSettings)
end repeat

repeat for each line tLine in pCC
  put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
tSettings)
end repeat

repeat for each line tLine in pBCC
  put tsNetSmtpSync(tServer, tFrom, tLine, tData, rOutHeaders, rBytes, 
tSettings)
end repeat

The last repeat sends to the BCC recipients.



-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 03.03.2021 um 23:19 schrieb Rick Harrison via use-livecode 
> :
> 
> Ok, everything is fine on the format front now.
> 
> I noticed the code takes about a minute to execute all the way through.
> (Must be a lot of background process have to run?)
> 
> I tried Charles Warwick’s suggestion for Bcc, and it didn’t work. :-(
> If any of you want to take a crack at it, please let me know your results.
> 
> Thanks to everyone!
> 
> Rick
> ___
> 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


Re: tsNet mail message not formatting

2021-03-03 Thread Rick Harrison via use-livecode
Ok, everything is fine on the format front now.

I noticed the code takes about a minute to execute all the way through.
(Must be a lot of background process have to run?)

I tried Charles Warwick’s suggestion for Bcc, and it didn’t work. :-(
If any of you want to take a crack at it, please let me know your results.

Thanks to everyone!

Rick
___
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


Re: tsNet mail message not formatting

2021-03-03 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

> OK Now I am interested. I have a little utility that converts a Konica
> Minolta address book to a Toshiba one. If I run the utility on a Mac,
> the address book will not import into a Toshiba copier, but if I first
> OPEN the csv file in WINDOWS, then save and close it, suddenly it WILL
> import. I tracked this down some time ago to the fact that the line
> endings were different than the Toshiba was expecting. I thought I
> fixed it by using LF but I have the same problem as before. From what
> I am reading, the LC constants will return a different result on LC
> for Windows as opposed to LC for Mac??

It may be that Konica believes all computers run Windows. Silly as it 
sounds, I've seen that from some manufacturers.


When writing a file from LC in text mode, line endings are altered.

Originally, the way in which they were altered was to create a text file 
that played nice with other programs on the host OS.


Internally, LC uses the Unix convention for line endings, LF (made 
confusing by allowing CR to also be used for the same internal line ending).


When writing to a file in text mode, what line endings are converted to 
varies by what's most common on that platform:


Linux: LF is preserved as-is

Windows: LF becomes CRLF

macOS: LF becomes CR

The problem is that macOS (v10 and later) is a Unix, unlike MacOS (v9 
and earlier) which was its own trippy little island unto itself.


Unix (including macOS) most commonly uses LF for line endings, but when 
LC writes out in text mode on macOS it still uses the older MacOS line 
ending, CR.


None of this is made any clearer by Apple's decision to use MacOS to 
denote OS 9 and earler, and macOS for 10 and later. :)


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com


___
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


Re: tsNet mail message not formatting

2021-03-03 Thread matthias rebbe via use-livecode
The problem is,  put URL file:  uses the line endings of the os where the it is 
executed, even if you have a container/variable with some text and line endings 
CRLF. As soon as you use put  into URL "file:..." the line endings are 
converted to the default ones of the os where the code is excecuted. In case of 
macOS the line endings are converted from CRLF to CR.

If you want to keep the CRLF line endings on macOS then you have to use put 
 into URL "binfile:..."  In this case the written data keeps the line 
endings you used when "filling" the container/variable.




-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 03.03.2021 um 22:43 schrieb Bob Sneidar via use-livecode 
> :
> 
> OK Now I am interested. I have a little utility that converts a Konica 
> Minolta address book to a Toshiba one. If I run the utility on a Mac, the 
> address book will not import into a Toshiba copier, but if I first OPEN the 
> csv file in WINDOWS, then save and close it, suddenly it WILL import. I 
> tracked this down some time ago to the fact that the line endings were 
> different than the Toshiba was expecting. I thought I fixed it by using LF 
> but I have the same problem as before. From what I am reading, the LC 
> constants will return a different result on LC for Windows as opposed to LC 
> for Mac??
> 
> Bob S
> 
> 
> On Mar 3, 2021, at 11:51 AM, Brian Milby via use-livecode 
> mailto:use-livecode@lists.runrev.com>> wrote:
> 
> If you want to be the most accurate (clear for others reading code) you would 
> use the LF constant instead of CR since that is how it actually evaluates.  
> The only way to generate an actual CR within code is to use CRLF (which gets 
> both) or use numtobyte(13).
> 
> If you export as text, then you get what is expected on Win/Linux and get CR 
> on Mac (which is wrong in my opinion).
> 
> Sent from my iPhone
> 
> ___
> 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


Re: tsNet mail message not formatting

2021-03-03 Thread Bob Sneidar via use-livecode
OK Now I am interested. I have a little utility that converts a Konica Minolta 
address book to a Toshiba one. If I run the utility on a Mac, the address book 
will not import into a Toshiba copier, but if I first OPEN the csv file in 
WINDOWS, then save and close it, suddenly it WILL import. I tracked this down 
some time ago to the fact that the line endings were different than the Toshiba 
was expecting. I thought I fixed it by using LF but I have the same problem as 
before. From what I am reading, the LC constants will return a different result 
on LC for Windows as opposed to LC for Mac??

Bob S


On Mar 3, 2021, at 11:51 AM, Brian Milby via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

If you want to be the most accurate (clear for others reading code) you would 
use the LF constant instead of CR since that is how it actually evaluates.  The 
only way to generate an actual CR within code is to use CRLF (which gets both) 
or use numtobyte(13).

If you export as text, then you get what is expected on Win/Linux and get CR on 
Mac (which is wrong in my opinion).

Sent from my iPhone

___
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


Re: tsNet mail message not formatting

2021-03-03 Thread Richard Gaskin via use-livecode

Brian Milby wrote:

> If you export as text, then you get what is expected on Win/Linux and
> get CR on Mac (which is wrong in my opinion).

Wrong, but at least consistently so. ;)

As a dialect of HyperTalk, LC maintains the "CR = ASCII 13" rule because 
way back in '87 when HC was born that was what it was.


When macOS became a Unix around the turn of the century of course that 
changed, and these days most Mac software use LF for line endings, 
consistent with both Unix and Linux.


And with that we find ourselves stuck in a world of having to explain to 
every new user that CR isn't really CR but LF, until you write it to a 
file when it gets transformed into a CR that no one uses anymore.


If this were Python the solution would be simple enough: make it current 
in the engine and "just" require everyone to rewrite their code if they 
want to upgrade. :)


But we like that LC is among the few languages that prioritizes backward 
compatibility.


Most of the time.

This one is such a weird outdated anomaly that I almost wouldn't mind 
the pain of revising my code if it meant never having that awkward 
conversation with once-eager newcomers ever again.


But that can be resolved another way: focusing on remarketing to 
existing customers rather than marketing to grow the platform among new 
customers minimizes any need to explain the past to new users.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
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


Re: tsNet mail message not formatting

2021-03-03 Thread Brian Milby via use-livecode
If you want to be the most accurate (clear for others reading code) you would 
use the LF constant instead of CR since that is how it actually evaluates.  The 
only way to generate an actual CR within code is to use CRLF (which gets both) 
or use numtobyte(13).

If you export as text, then you get what is expected on Win/Linux and get CR on 
Mac (which is wrong in my opinion).

Sent from my iPhone

> On Mar 3, 2021, at 12:40 PM, Sean Cole (Pi) via use-livecode 
>  wrote:
> 
> You have to do this:
> 
> replace cr with crlf in tBody
> 
> Personal Btw: I find that using ‘return’ results in ugly code as a personal
> preference, so I avoid that and use cr. it’s just that the script renderer
> shows ‘return’ in yellow for it’s command equivalent because they still
> haven’t coded the editor to work out if you are using it as the command or
> the keyword.
> 
> All the best.
> 
>> On Wed, 3 Mar 2021 at 17:41, matthias rebbe via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>> 
>> Tried this script here on macOS
>> 
>> put "this is line 1" &"this is line 2" into tBody
>> 
>> put "xx" into tFrom
>> 
>> put "xxx...@me.com" into tTo
>> 
>> put "Email test" into tSubject
>> 
>> put "" into tSettings["username"]
>> 
>> put "" into tSettings["password"]
>> 
>> put TRUE into tSettings["NO_REUSE"]
>> 
>> put "smtp://xxx.xxx.Xxx.xxx" into tServer
>> 
>> mimeEncodeAsMIMEEmail tBody,tFrom,tTo,"",tSubject
>> 
>> put it into tData
>> 
>> put tsNetSmtpSync(tServer, tFrom, tTo, tData, rOutHeaders, rBytes,
>> tSettings)
>> 
>> 
>> The email body is showing 2 lines in Apple Mail as expected.
>> 
>> Could you show your code, at least the coder which you are using to
>> fill/create the message (smtp header and body)?
>> 
>> 
>> 
>> -
>> Matthias Rebbe
>> Life Is Too Short For Boring Code
>> 
>>> Am 03.03.2021 um 18:09 schrieb Rick Harrison via use-livecode <
>> use-livecode@lists.runrev.com>:
>>> 
>>> I want to send a message that has multiple lines.
>>> I have tried inserting cr and return and nothing
>>> works so far. The message ends up on a same line.
>>> 
>>> Ideas?
>>> 
>>> Thanks,
>>> 
>>> Rick
>>> 
>>> ___
>>> 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
>> 
> -- 
> Pi Digital
> ___
> 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


Re: tsNet mail message not formatting

2021-03-03 Thread Sean Cole (Pi) via use-livecode
You have to do this:

replace cr with crlf in tBody

Personal Btw: I find that using ‘return’ results in ugly code as a personal
preference, so I avoid that and use cr. it’s just that the script renderer
shows ‘return’ in yellow for it’s command equivalent because they still
haven’t coded the editor to work out if you are using it as the command or
the keyword.

All the best.

On Wed, 3 Mar 2021 at 17:41, matthias rebbe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Tried this script here on macOS
>
> put "this is line 1" &"this is line 2" into tBody
>
> put "xx" into tFrom
>
> put "xxx...@me.com" into tTo
>
> put "Email test" into tSubject
>
> put "" into tSettings["username"]
>
> put "" into tSettings["password"]
>
> put TRUE into tSettings["NO_REUSE"]
>
> put "smtp://xxx.xxx.Xxx.xxx" into tServer
>
> mimeEncodeAsMIMEEmail tBody,tFrom,tTo,"",tSubject
>
> put it into tData
>
> put tsNetSmtpSync(tServer, tFrom, tTo, tData, rOutHeaders, rBytes,
> tSettings)
>
>
> The email body is showing 2 lines in Apple Mail as expected.
>
> Could you show your code, at least the coder which you are using to
> fill/create the message (smtp header and body)?
>
>
>
> -
> Matthias Rebbe
> Life Is Too Short For Boring Code
>
> > Am 03.03.2021 um 18:09 schrieb Rick Harrison via use-livecode <
> use-livecode@lists.runrev.com>:
> >
> > I want to send a message that has multiple lines.
> > I have tried inserting cr and return and nothing
> > works so far. The message ends up on a same line.
> >
> > Ideas?
> >
> > Thanks,
> >
> > Rick
> >
> > ___
> > 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
>
-- 
Pi Digital
___
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


Re: tsNet mail message not formatting

2021-03-03 Thread matthias rebbe via use-livecode
Tried this script here on macOS

put "this is line 1" &"this is line 2" into tBody

put "xx" into tFrom

put "xxx...@me.com" into tTo

put "Email test" into tSubject

put "" into tSettings["username"]

put "" into tSettings["password"]

put TRUE into tSettings["NO_REUSE"]

put "smtp://xxx.xxx.Xxx.xxx" into tServer

mimeEncodeAsMIMEEmail tBody,tFrom,tTo,"",tSubject

put it into tData

put tsNetSmtpSync(tServer, tFrom, tTo, tData, rOutHeaders, rBytes, tSettings)


The email body is showing 2 lines in Apple Mail as expected.

Could you show your code, at least the coder which you are using to fill/create 
the message (smtp header and body)?



-
Matthias Rebbe
Life Is Too Short For Boring Code

> Am 03.03.2021 um 18:09 schrieb Rick Harrison via use-livecode 
> :
> 
> I want to send a message that has multiple lines.
> I have tried inserting cr and return and nothing
> works so far. The message ends up on a same line.
> 
> Ideas?
> 
> Thanks,
> 
> Rick
> 
> ___
> 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


RE: tsNet mail message not formatting

2021-03-03 Thread Ralph DiMola via use-livecode
There are 2 things(at least) that I can't believe in 2021 have
standards.
1) Fonts and their names/faces
2) Carriage returns/new lines/line feed


In LC(on windows) both cr and lf have a chartonum value of 10

Try a numtochar(13) or numtochar(13)(10)

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Rick Harrison via use-livecode
Sent: Wednesday, March 03, 2021 12:10 PM
To: How to use LiveCode
Cc: Rick Harrison
Subject: tsNet mail message not formatting

I want to send a message that has multiple lines.
I have tried inserting cr and return and nothing works so far. The message
ends up on a same line.

Ideas?

Thanks,

Rick

___
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