Sending email using a SMTP server from TD 5.1

forum.sourcecode (2000-2005) & forum.td.sourcecode (2005-2010)
NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Sending email using a SMTP server from TD 5.1

Post by NewsgroupServer » 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

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Sending email using a SMTP server from TD 5.1

Post by NewsgroupServer » 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

Attachment: WSock32_51.zip

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Sending email using a SMTP server from TD 5.1

Post by NewsgroupServer » 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

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Sending email using a SMTP server from TD 5.1

Post by NewsgroupServer » 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

NewsgroupServer
Robot
Robot
Posts: 118939
Joined: 24 Feb 2017, 12:00
Location: World wide

Sending email using a SMTP server from TD 5.1

Post by NewsgroupServer » 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) ;-)

Return to “td.sourcecode”

Who is online

Users browsing this forum: Ccbot [Crawler] and 0 guests