Re: [twsocket] Need a simple SMTP example

2007-01-13 Thread Arno Garrels
[EMAIL PROTECTED] wrote:
 Hi Michael,
 
 Sorry, I sent my previous reply directly to you instead of to the
 list. 
 
 thanks for the hint, I already looked into the code and - by the
 way - I find it very well structured. However, one question is
 left. There´s always spoken about using async components, but in my
 special case 
 
 isn´t it easier to use the respective sync component?
 
 In this case I think you're right, and I've been known to do that in
 the past as well - saves having to worry about implementing timeouts
 because I believe there's a timeout parameter for the Sync versions
 of the functions.   
 
 It is quite simple: I´m opening a query on a database, iterating
 through the result set and have to send one mail for each record (=
 customer). I can´t advance to the next record until the mail has
 been delivered, so a sync component would be (possibly?)
 preferrable. And as far as I´m understanding it, I can concatenate
 the sync commands rather than advancing to the next command in
 OnRequestDone - am I right here? 
 
 Yes, that's right, you can just run one command after the other,
 possibly with appropriate error checking as well. 

There's no need to use sync mode. I've done so twice in an ICS-mailer
against a MS SQL server. In OnRequestDone do whatever you like with
the dataset depending on current RqType and ErrCode. It gives you
much better control!

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html



 Regards,
 
 Bevan Edwards
 
 
 
 
 
 
 
 
 
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Need a simple SMTP example

2007-01-13 Thread Michael Kochendoerfer
Arno,

if I'd do it the way you suggest (do it async, fetching the next record 
in OnRequestDone and start over sending), may I use screen output from 
there, including .ProcessMessages? I know that a good application should 
display information based on a timer or such, i.e. re-displaying all 
info each n msecs, but for the first version, I'm very short on time ...

Afaik, it should be avoided to call the message pump from /*any*/ ICS 
event, or is this only true for OnDataAvailable?

Another question is, am I allowed to use .Abort from inside 
OnRequestDone when an error occurs? It seems to work, but I'm quite 
unsure if this is the correct way to abort a failing SMTP transmission.

Michael


Arno Garrels schrieb:

[EMAIL PROTECTED] wrote:
  

Hi Michael,

Sorry, I sent my previous reply directly to you instead of to the
list. 

  

thanks for the hint, I already looked into the code and - by the
way - I find it very well structured. However, one question is
left. There´s always spoken about using async components, but in my
special case 

isn´t it easier to use the respective sync component?


In this case I think you're right, and I've been known to do that in
the past as well - saves having to worry about implementing timeouts
because I believe there's a timeout parameter for the Sync versions
of the functions.   

  

It is quite simple: I´m opening a query on a database, iterating
through the result set and have to send one mail for each record (=
customer). I can´t advance to the next record until the mail has
been delivered, so a sync component would be (possibly?)
preferrable. And as far as I´m understanding it, I can concatenate
the sync commands rather than advancing to the next command in
OnRequestDone - am I right here? 


Yes, that's right, you can just run one command after the other,
possibly with appropriate error checking as well. 
  


There's no need to use sync mode. I've done so twice in an ICS-mailer
against a MS SQL server. In OnRequestDone do whatever you like with
the dataset depending on current RqType and ErrCode. It gives you
much better control!

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html



  

Regards,

Bevan Edwards






  




--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
  


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Need a simple SMTP example

2007-01-13 Thread Arno Garrels
Michael Kochendoerfer wrote:
 Arno,
 
 if I'd do it the way you suggest (do it async, fetching the next
 record 
 in OnRequestDone and start over sending), may I use screen output from
 there, 

Yes, of course, take a look at the demo.

 including .ProcessMessages? 

No no, why would you need that?

 I know that a good application
 should 
 display information based on a timer or such, i.e. re-displaying all
 info each n msecs, but for the first version, I'm very short on time
 ... 

What do you want to display? Sure, a full log displayed in a GUI control,
including all data being sent will slow down entire application since
displaying data in Windows is very very slow. 

 
 Afaik, it should be avoided to call the message pump from /*any*/ ICS
 event, 

That's not ICS-specific, don't call the message pump from any (message-
based) event handler.

 or is this only true for OnDataAvailable?

See above.

 
 Another question is, am I allowed to use .Abort from inside
 OnRequestDone when an error occurs? 

Yes. 

It seems to work, but I'm quite
 unsure if this is the correct way to abort a failing SMTP
 transmission. 

What do you mean by failing SMTP transmission? 
Most error responses from a mail server should/can be handled
diffently.


---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


 
 Michael
 
 
 Arno Garrels schrieb:
 
 [EMAIL PROTECTED] wrote:
 
 
 Hi Michael,
 
 Sorry, I sent my previous reply directly to you instead of to the
 list.
 
 
 
 thanks for the hint, I already looked into the code and - by the
 way - I find it very well structured. However, one question is
 left. There´s always spoken about using async components, but in
 my special case
 
 isn´t it easier to use the respective sync component?
 
 
 In this case I think you're right, and I've been known to do that
 in the past as well - saves having to worry about implementing
 timeouts because I believe there's a timeout parameter for the
 Sync versions of the functions.
 
 
 
 It is quite simple: I´m opening a query on a database, iterating
 through the result set and have to send one mail for each record
 (= customer). I can´t advance to the next record until the mail
 has been delivered, so a sync component would be (possibly?)
 preferrable. And as far as I´m understanding it, I can concatenate
 the sync commands rather than advancing to the next command in
 OnRequestDone - am I right here?
 
 
 Yes, that's right, you can just run one command after the other,
 possibly with appropriate error checking as well.
 
 
 
 There's no need to use sync mode. I've done so twice in an ICS-mailer
 against a MS SQL server. In OnRequestDone do whatever you like with
 the dataset depending on current RqType and ErrCode. It gives you
 much better control!
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 
 
 
 
 Regards,
 
 Bevan Edwards
 
 
 
 
 
 
 
 
 
 
 
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Need a simple SMTP example

2007-01-13 Thread Dod
Hello bevan,

Is it text file or binary file ?

If  text  file  be  sure  to set binary mode, if not all #13#10 may be
converted  into  #10  if  destination is Unix system so each text line
will loose 1 byte.

regards.

bacn Sorry, I sent my previous reply directly to you instead of to the list.

 thanks for the hint, I already looked into the code and - by the way - I
 find it very well structured. However, one question is left. ThereŽs
 always spoken about using async components, but in my special case
 
 isnŽt it easier to use the respective sync component?

bacn In this case I think you're right, and I've been known to do that in the 
past as well - saves having to worry about implementing timeouts because I 
believe there's a timeout parameter for the
bacn Sync versions of the functions.

 It is quite simple: IŽm opening a query on a database, iterating through
 the result set and have to send one mail for each record (= customer). I
 canŽt advance to the next record until the mail has been delivered, so a
 sync component would be (possibly?) preferrable. And as far as IŽm
 understanding it, I can concatenate the sync commands rather than
 advancing to the next command in OnRequestDone - am I right here?

bacn Yes, that's right, you can just run one command after the other, possibly 
with appropriate error checking as well.

bacn Regards,

bacn Bevan Edwards


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Need a simple SMTP example

2007-01-13 Thread Arno Garrels
Dod wrote:
 Hello bevan,
 
 Is it text file or binary file ?
 
 If  text  file  be  sure  to set binary mode, 

In SMTP??

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html



if not all #13#10 may be
 converted  into  #10  if  destination is Unix system so each text line
 will loose 1 byte.
 
 regards.
 
 bacn Sorry, I sent my previous reply directly to you instead of to
 the list. 
 
 thanks for the hint, I already looked into the code and - by the
 way - I find it very well structured. However, one question is
 left. ThereŽs always spoken about using async components, but in my
 special case 
 
 isnŽt it easier to use the respective sync component?
 
 bacn In this case I think you're right, and I've been known to do
 that in the past as well - saves having to worry about implementing
 timeouts because I believe there's a timeout parameter for the  
 bacn Sync versions of the functions.
 
 It is quite simple: IŽm opening a query on a database, iterating
 through the result set and have to send one mail for each record (=
 customer). I canŽt advance to the next record until the mail has
 been delivered, so a sync component would be (possibly?)
 preferrable. And as far as IŽm understanding it, I can concatenate
 the sync commands rather than advancing to the next command in
 OnRequestDone - am I right here? 
 
 bacn Yes, that's right, you can just run one command after the
 other, possibly with appropriate error checking as well. 
 
 bacn Regards,
 
 bacn Bevan Edwards
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Need a simple SMTP example

2007-01-13 Thread DZ-Jay

On Jan 13, 2007, at 04:50, Dod wrote:

 Hello bevan,

 Is it text file or binary file ?

 If  text  file  be  sure  to set binary mode, if not all #13#10 may be
 converted  into  #10  if  destination is Unix system so each text line
 will loose 1 byte.

In SMTP, you encode the file using MIME Base64 encoding if its binary, 
and quoted-printable if its plaintext.  Actually, you can use Base64 
for both without any problems.

dZ.
-- 
DZ-Jay [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Need a simple SMTP example

2007-01-12 Thread Michael Kochendoerfer
Dear community,

a critical situation forces me to implement a quick way for sending 
mailings with ICS components (all other stuff out there won't work 
properly, they told me). In fact, it is a rather simple scenario - 
walking through a customer database and sending SMTP mails to some 
customers, plain text and no HTML, but with one or two attachments (PDF 
files). It should be accomplished using Delphi 7, and we've currently 
installed ICS / SmtpProt v2.38.

We'd like to upgrade to the most recent version next week, but work 
needs to be done right now :-(

Can someone point me into the right direction for completing the 
required tasks by showing an example or directing me to some sample files?

TIA,
Michael


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Need a simple SMTP example

2007-01-12 Thread bevan
Hi Michael,

Sorry, I sent my previous reply directly to you instead of to the list.

 thanks for the hint, I already looked into the code and - by the way - I
 find it very well structured. However, one question is left. There´s
 always spoken about using async components, but in my special case
 
 isn´t it easier to use the respective sync component?

In this case I think you're right, and I've been known to do that in the past 
as well - saves having to worry about implementing timeouts because I believe 
there's a timeout parameter for the Sync versions of the functions.

 It is quite simple: I´m opening a query on a database, iterating through
 the result set and have to send one mail for each record (= customer). I
 can´t advance to the next record until the mail has been delivered, so a
 sync component would be (possibly?) preferrable. And as far as I´m
 understanding it, I can concatenate the sync commands rather than
 advancing to the next command in OnRequestDone - am I right here?

Yes, that's right, you can just run one command after the other, possibly with 
appropriate error checking as well.

Regards,

Bevan Edwards





-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be