tSettings["username"]

Matthias Rebbe matthias_livecode_150811 at m-r-d.de
Fri Sep 16 19:00:20 EDT 2016


> Am 16.09.2016 um 22:29 schrieb Mark Clark <markclark at mac.com <mailto:markclark at mac.com>>:
> 
> Thanks for all the help so far. I forgot to ask -- what is the best way to add multiple recipients, BCC, etc?
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com <mailto: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


regarding the  multiple to:

1. you have to add the additional To recipients also to the smtp Header. You have to separate the recipients with Comma. 
The line must end with CRLF. 

To: email1 at runrev.com <mailto:email1 at runrev.com>, email2 at runrev.com <mailto:email2 at runrev.com>, email3 at runrev.com <mailto:email3 at runrev.com>

For CC recipients it´s the same
Cc: me at livecode.com <mailto:me at livecode.com>, you at livecode.com <mailto:you at livecode.com>, who at livecode.com <mailto:who at livecode.com>

A sample smtp header would then look like this:

Content-Type: text/plain; charset=utf-8
Date: Sat, 17 Sep 2016 00:37:04 +0200
From: support at myawesomecompany.com <mailto:support at myawesomecompany.com>
To: email1 at runrev.com <mailto:email1 at runrev.com>, email2 at runrev.com <mailto:email2 at runrev.com>, email3 at runrev.com <mailto:email3 at runrev.com>
Cc: me at livecode.com <mailto:me at livecode.com>, you at livecode.com <mailto:you at livecode.com>, who at livecode.com <mailto:who at livecode.com>
Subject: =?UTF-8?B?TWVzc2FnZSB3aXRoIG5vbiBBU0NJSSDDs8K/wqHDoSc=?=

This is the message.



Very important : Bcc Recipients are not added to the SMTP header ! ! !


2. for sending you have to call the tsNetSmptSync function for every To, Cc and Bcc recipient.

Lets say you have a To, a Cc and Bcc field. Every line contains a emailadress.


then for the To recipients you would write:

repeat for each line tRecipient in fld “To”
if line tRecipient is empty then next repeat
put tsNetSmtpSync(tURL, tSender, tRecipient, tPostData, tResponseHeaders,tBytes,tSettings) into tResult
end repeat

for the Cc recipients:

repeat for each line tRecipient in fld “Cc”
if line tRecipient is empty then next repeat
put tsNetSmtpSync(tURL, tSender, tRecipient, tPostData, tResponseHeaders,tBytes,tSettings) into tResult
end repeat

and for the Bcc:

repeat for each line tRecipient in fld “Bcc”
if line tRecipient is empty then next repeat
put tsNetSmtpSync(tURL, tSender, tRecipient, tPostData, tResponseHeaders,tBytes,tSettings) into tResult
end repeat


Regarding Dave´s question about Html. As you mentioned already,Sarahs library gives good advice how to implement that and it should work with tsNet. At least if you create smtp message (tPostData) correctly.

For those who are intrested in Sarah´s scripts and library: She uploaded hem all to GitHub
https://github.com/trozware/rev_stacks <https://github.com/trozware/rev_stacks>

Regards,

Matthias






Matthias Rebbe
Bramkampsieke 13
32312 Lübbecke
Tel	+49 5741 310000
    	+49 160 5504462
Fax: +49 5741 310002
eMail: matthias at m-r-d.de <mailto:matthias at m-r-d.de>

BR5 Konverter - BR5 -> MP3 <http://matthiasrebbe.eu/portfolio/produkte/brx/>



More information about the use-livecode mailing list