tsNetSmtpSync

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bertBUSIbr8
Posts: 38
Joined: Thu Jun 28, 2012 2:48 pm
Location: West-Cork, Ireland
Contact:

tsNetSmtpSync

Post by bertBUSIbr8 » Thu Oct 25, 2018 1:23 pm

Hi,


I have the tsNetSmtpSync command working in that it sends emails fine.

What I do get is that the arriving email show "undisclosed-recipients" instead of the recipients email address.

Is there a way to have the recipients email address showing?


Secondly, how can you add a subject line?


Many thanks,


Bert

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: tsNetSmtpSync

Post by Klaus » Thu Oct 25, 2018 1:50 pm

Hi Bert,
bertBUSIbr8 wrote:
Thu Oct 25, 2018 1:23 pm
...What I do get is that the arriving email show "undisclosed-recipients" instead of the recipients email address.
Is there a way to have the recipients email address showing?
sorry, no idea.
bertBUSIbr8 wrote:
Thu Oct 25, 2018 1:23 pm
...Secondly, how can you add a subject line?
From the dictionary:
...
pData
The e-mail message that is to be send to the server. This should include the e-mail header followed by a blank line and then the body of the e-mail.
...
I guess "e-mail header" is in fact the subject line, at least worth a try :-)


Best

Klaus

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: tsNetSmtpSync

Post by Klaus » Thu Oct 25, 2018 1:59 pm


bertBUSIbr8
Posts: 38
Joined: Thu Jun 28, 2012 2:48 pm
Location: West-Cork, Ireland
Contact:

Re: tsNetSmtpSync

Post by bertBUSIbr8 » Thu Oct 25, 2018 2:06 pm

Hi Klaus,


Thanks for your reply. I had come across that but could make something work. However, looking back at the sample stack mentioned here:

http://lessons.livecode.com/m/4071/l/68 ... t-external

If I put something like this:

put "From: Me <me@mydomain.com>" & cr & "To: bert <recipient1@mydomain.com>" & cr & "Cc: Someone <recipient2@yourdomain.com>" & cr &"Subject: Test Message" & cr &"message body" into tPostData

That will actually wokr in that it sets the from, to, subject etc. for the email and show up ok when it arrives. So just a matter of dynamically populating it with the correct data.


Bert

charlesBUSd8qF
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 39
Joined: Wed Apr 11, 2012 10:28 pm

Re: tsNetSmtpSync

Post by charlesBUSd8qF » Fri Oct 26, 2018 7:17 am

Hi All,

Sending messages via the tsNetSmtp* functions can be a bit confusing at first if you are not familiar with the SMTP protocol.

When sending e-mail via SMTP, the sender and recipients addresses are specified separately to the actual contents of the e-mail message. However, when an e-mail client displays the "From" and "To" addresses (along with the e-mail "Subject"), it uses the e-mail headers specified in the actual e-mail message that has been sent.

The e-mail headers are sent as part of the e-mail message (usually one per line) followed by a blank line and then the body of the e-mail message.

Bert's response above is a nice simple example, it sets the From:, To:, Cc: and Subject: headers that will be displayed by the e-mail client.

Charles

Post Reply

Return to “Talking LiveCode”