> Am 16.09.2016 um 22:29 schrieb Mark Clark <[email protected] 
> <mailto:[email protected]>>:
> 
> 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
> [email protected] <mailto:[email protected]>
> 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: [email protected] <mailto:[email protected]>, [email protected] 
<mailto:[email protected]>, [email protected] <mailto:[email protected]>

For CC recipients it´s the same
Cc: [email protected] <mailto:[email protected]>, [email protected] 
<mailto:[email protected]>, [email protected] <mailto:[email protected]>

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: [email protected] <mailto:[email protected]>
To: [email protected] <mailto:[email protected]>, [email protected] 
<mailto:[email protected]>, [email protected] <mailto:[email protected]>
Cc: [email protected] <mailto:[email protected]>, [email protected] 
<mailto:[email protected]>, [email protected] <mailto:[email protected]>
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: [email protected] <mailto:[email protected]>

BR5 Konverter - BR5 -> MP3 <http://matthiasrebbe.eu/portfolio/produkte/brx/>
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to