Sending email using a SMTP server from TD 5.1

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
Adam

Sending email using a SMTP server from TD 5.1

Post by Adam » 01 Feb 2009, 00:04

 Posted by:  Adam 

Works the SMTP code provided by Stefan Beltrame with TD 5.1?
How to migrate from TD 2005.1?

Thanks

Adam

sbeltrame
Switzerland
Posts: 216
Joined: 07 Jun 2022, 14:13
Location: Switzerland

Re: Sending email using a SMTP server from TD 5.1

Post by sbeltrame » 03 Feb 2009, 00:48

 Posted by:  Stefan Beltrame 

Hi Adam

Attached you find a version for TD 5.1.
Not fully tested!

Regards
Stefan
You do not have the required permissions to view the files attached to this post.

RainerE
Germany
Posts: 2261
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: Sending email using a SMTP server from TD 5.1

Post by RainerE » 16 Mar 2010, 16:48

 Posted by:  Rainer Ebert 

Hi Stefan,

why do you read the attachements in parts of 51 bytes (before you encode
them base64 and send them - ReadFile(nFile, nStream, 51, nRead, 0))? Why
don't you read them in larger parts (let's say 1024 bytes).

Rainer

sbeltrame
Switzerland
Posts: 216
Joined: 07 Jun 2022, 14:13
Location: Switzerland

Re: Sending email using a SMTP server from TD 5.1

Post by sbeltrame » 16 Mar 2010, 20:44

 Posted by:  Stefan Beltrame 

Hi Rainer

Standard RFC-2045 talks about 76 characters + CRLF.
That means 57 decoded characters per line.

(57 / 3) * 4 = 76

I use 51 (51 / 3 * 4 = 68) + 2 characters for CRLF = 70 because:

a) 70 was the age of my mother when I wrote the code
b) I had to much Shiraz
c) It's just a a typing error

Guess the right answer and send it in with $10 to my privat address.

Anyway, 57 should be the maximum for sending emails.
Of course for other purposes a larger value is also possible.

Regards

Stefan

RainerE
Germany
Posts: 2261
Joined: 27 Apr 2021, 12:40
Location: Germany

Re: Sending email using a SMTP server from TD 5.1

Post by RainerE » 17 Mar 2010, 10:14

 Posted by:  Rainer Ebert 

Hi Stefan,

thanks for the answer and for your great implementation, which works fine.

Regards,
Rainer

P.S.: I guess c) :wink:

Return to “td.sourcecode”

Who is online

Users browsing this forum: [Ccbot] and 0 guests