[twsocket] Images in HTML formatted email - incorrect enumeration IMAGEn
Hi My program is using demo of THtmlSmtpClient component. I have a little problem. I have two images in email. In HTML message code it is: ... IMG src=cid:'+'IMAGE1'+' width=90 height=88 border=0 alt=alt and IMG src=cid:'+'IMAGE2'+' width=90 height=88 border=0 alt=alt ... And then in SendButton procedure I have { Give the component the various data he need } HtmlSmtpClient.PlainText := nil; HtmlSmtpClient.HtmlText:= EmailBody; //html message code HtmlSmtpClient.EmailImages.Add(PathToImage1); HtmlSmtpClient.EmailImages.Add(PathToImage2); { Initialize all SMTP component properties from our GUI } HtmlSmtpClient.Host:= SmtpServerName; HtmlSmtpClient.Port:= IntToStr(SmtpServerPort); HtmlSmtpClient.FromName :=UserName + ' '+UserEmail+''; HtmlSmtpClient.HdrSubject :=TematWiadomosciE.Text; ... When I click This button mail is sending. Everything is OK. But, when mail is sent and if I click again button that sending next email there is an error. In html message code it is still ... cid: image1, but in code of ICS (I can see it in log, example: Content-Type: image/gif; name=image2.gif Content-Transfer-Encoding: base64 Content-Disposition: inline; filename=image2.gif Content-ID: IMAGE3 -- here is incorrect - it should be IMAGE2 ) the Image = Image3 and Image4. That is not correct - It should be again Image1 and Image2. So, how to change this? I hope You understand what I mean... Thanks in advance. Paweł Porwisz -- 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] Images in HTML formatted email - incorrect enumerationIMAGEn
Hi Solution of this problem is one line of code: HtmlSmtpClient.EmailImages.Clear; Now, it is working. Sorry, I should know that ;) Regards Paweł - Original Message - From: Paweł (WP) [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 2:06 PM Subject: [twsocket] Images in HTML formatted email - incorrect enumerationIMAGEn Hi My program is using demo of THtmlSmtpClient component. I have a little problem. I have two images in email. In HTML message code it is: ... IMG src=cid:'+'IMAGE1'+' width=90 height=88 border=0 alt=alt and IMG src=cid:'+'IMAGE2'+' width=90 height=88 border=0 alt=alt ... And then in SendButton procedure I have { Give the component the various data he need } HtmlSmtpClient.PlainText := nil; HtmlSmtpClient.HtmlText:= EmailBody; //html message code HtmlSmtpClient.EmailImages.Add(PathToImage1); HtmlSmtpClient.EmailImages.Add(PathToImage2); { Initialize all SMTP component properties from our GUI } HtmlSmtpClient.Host:= SmtpServerName; HtmlSmtpClient.Port:= IntToStr(SmtpServerPort); HtmlSmtpClient.FromName :=UserName + ' '+UserEmail+''; HtmlSmtpClient.HdrSubject :=TematWiadomosciE.Text; ... When I click This button mail is sending. Everything is OK. But, when mail is sent and if I click again button that sending next email there is an error. In html message code it is still ... cid: image1, but in code of ICS (I can see it in log, example: Content-Type: image/gif; name=image2.gif Content-Transfer-Encoding: base64 Content-Disposition: inline; filename=image2.gif Content-ID: IMAGE3 -- here is incorrect - it should be IMAGE2 ) the Image = Image3 and Image4. That is not correct - It should be again Image1 and Image2. So, how to change this? I hope You understand what I mean... Thanks in advance. Paweł Porwisz -- 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] HttpCli problem
The problem is that the STATE is not ready after the abort, so when I use httpcli to grab another file after a 302, I would get an error. (http component busy, I think). After an abort in such a case, is there anything that I have to do to make sure that the component is ready for the next use? (This only happens after a 302, anything else (200, 404, etc) works well.) -Ronny - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 3:59 AM Subject: Re: [twsocket] HttpCli problem After httpcli.abort is called, the statuscode is normally 404 if the statuscode before the call is 200. The statuscode is 0 if the original statuscode is 302. This is causing me problems (i.e. httpcli state is not ready after an abort is called if the statuscode was 302). See example: log.Lines.Add(inttostr(httpcli.StatusCode); httpcli.abort; log.Lines.Add(inttostr(httpcli.StatusCode); D7, ICS V6 beta V1.91 StatusCode value is valid only when or after OnRequestDone has been triggered. Anyway, if you abort, you obviously know what you are doing. No need to rely on StatusCode. -- [EMAIL PROTECTED] 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 -- 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] HttpCli problem
I did find a work-around, but it is not pretty: while httpcli.State httpready do begin a:=a+1; log.Lines.add('Waiting '+inttostr(a)); application.ProcessMessages; end; This is only needed after a 302. The counter ranges from 400-1000 before the state turns to httpready. And I am not sure that they are real 302s. The same pages give a statuscode of 302 consistently when downloaded in the same order, but may give a 200 if downloaded in a different order. Could a bug in my program make httpcli give a fake 302 statuscode? (The above code gives an infinite loop if application.processmessages is removed) - Original Message - From: Ronny [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 10:08 AM Subject: Re: [twsocket] HttpCli problem The problem is that the STATE is not ready after the abort, so when I use httpcli to grab another file after a 302, I would get an error. (http component busy, I think). After an abort in such a case, is there anything that I have to do to make sure that the component is ready for the next use? (This only happens after a 302, anything else (200, 404, etc) works well.) -Ronny - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 3:59 AM Subject: Re: [twsocket] HttpCli problem After httpcli.abort is called, the statuscode is normally 404 if the statuscode before the call is 200. The statuscode is 0 if the original statuscode is 302. This is causing me problems (i.e. httpcli state is not ready after an abort is called if the statuscode was 302). See example: log.Lines.Add(inttostr(httpcli.StatusCode); httpcli.abort; log.Lines.Add(inttostr(httpcli.StatusCode); D7, ICS V6 beta V1.91 StatusCode value is valid only when or after OnRequestDone has been triggered. Anyway, if you abort, you obviously know what you are doing. No need to rely on StatusCode. -- [EMAIL PROTECTED] 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 -- 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] HttpCli problem
Hello Ronny, The problem is that the STATE is not ready after the abort Do you also mean that OnRequestDone is not fired after Abort ? Because normally this is the place to check if component is ready, and when it is then take next action. If this is the case then I assume state will be ready immediatly after abort. So you can take the next action probably in a custom message handler. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, February 25, 2006, 16:08, Ronny wrote: The problem is that the STATE is not ready after the abort, so when I use httpcli to grab another file after a 302, I would get an error. (http component busy, I think). After an abort in such a case, is there anything that I have to do to make sure that the component is ready for the next use? (This only happens after a 302, anything else (200, 404, etc) works well.) -Ronny - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 3:59 AM Subject: Re: [twsocket] HttpCli problem After httpcli.abort is called, the statuscode is normally 404 if the statuscode before the call is 200. The statuscode is 0 if the original statuscode is 302. This is causing me problems (i.e. httpcli state is not ready after an abort is called if the statuscode was 302). See example: log.Lines.Add(inttostr(httpcli.StatusCode); httpcli.abort; log.Lines.Add(inttostr(httpcli.StatusCode); D7, ICS V6 beta V1.91 StatusCode value is valid only when or after OnRequestDone has been triggered. Anyway, if you abort, you obviously know what you are doing. No need to rely on StatusCode. -- [EMAIL PROTECTED] 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 -- 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] HttpCli problem
The problem is that the STATE is not ready after the abort, so when I use httpcli to grab another file after a 302, I would get an error. (http component busy, I think). After an abort in such a case, is there anything that I have to do to make sure that the component is ready for the next use? (This only happens after a 302, anything else (200, 404, etc) works well.) Use the OnRequestDone event which is triggered if you abort while an operation was already started (the componentis busy). -- [EMAIL PROTECTED] 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
[twsocket] ICS on Mac OS X
Hi, is ICS working on Mac OS X with Freepascal? I've just booted Mac OS X for the first time in my life. Benjamin Stadin -- 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] ICS on Mac OS X
is ICS working on Mac OS X with Freepascal? I've just booted Mac OS X for the first time in my life. Does Mac OS X support winsock and messaging ? I guess not. But probably the Kylix version would work since it only use unix sockets. -- [EMAIL PROTECTED] 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] HttpCli problem
That is the problem. This routine is called from OnRequestDone. That is why I think that there is a bug. OnRequestDone gets called twice for 302s, but I have already taken that into account. Should httpcli.State = httpReady when OnRequestDone is called? If so, this is not the case with 302. - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 11:22 AM Subject: Re: [twsocket] HttpCli problem Why use a loop ? Why don't you want to use OnRequestDone event ? -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Ronny [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 4:57 PM Subject: Re: [twsocket] HttpCli problem I did find a work-around, but it is not pretty: while httpcli.State httpready do begin a:=a+1; log.Lines.add('Waiting '+inttostr(a)); application.ProcessMessages; end; This is only needed after a 302. The counter ranges from 400-1000 before the state turns to httpready. And I am not sure that they are real 302s. The same pages give a statuscode of 302 consistently when downloaded in the same order, but may give a 200 if downloaded in a different order. Could a bug in my program make httpcli give a fake 302 statuscode? (The above code gives an infinite loop if application.processmessages is removed) - Original Message - From: Ronny [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 10:08 AM Subject: Re: [twsocket] HttpCli problem The problem is that the STATE is not ready after the abort, so when I use httpcli to grab another file after a 302, I would get an error. (http component busy, I think). After an abort in such a case, is there anything that I have to do to make sure that the component is ready for the next use? (This only happens after a 302, anything else (200, 404, etc) works well.) -Ronny - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 3:59 AM Subject: Re: [twsocket] HttpCli problem After httpcli.abort is called, the statuscode is normally 404 if the statuscode before the call is 200. The statuscode is 0 if the original statuscode is 302. This is causing me problems (i.e. httpcli state is not ready after an abort is called if the statuscode was 302). See example: log.Lines.Add(inttostr(httpcli.StatusCode); httpcli.abort; log.Lines.Add(inttostr(httpcli.StatusCode); D7, ICS V6 beta V1.91 StatusCode value is valid only when or after OnRequestDone has been triggered. Anyway, if you abort, you obviously know what you are doing. No need to rely on StatusCode. -- [EMAIL PROTECTED] 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 -- 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 -- 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] HttpCli problem
Why use a loop ? Why don't you want to use OnRequestDone event ? That is the problem. This routine is called from OnRequestDone. That is why I think that there is a bug. OnRequestDone gets called twice for 302s, but I have already taken that into account. Should httpcli.State = httpReady when OnRequestDone is called? If so, this is not the case with 302. There is no reason to call Abort from OnRequestDone which is the time when the request is... done ! Why do you think you need to call Abort from OnRequestDone ? I you really have a good reason (I like to hear it), then PostMessage a custom message and then exit. Then from the corresponding event handler, call Abort. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] 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] HttpCli problem
Hello Ronny, Should httpcli.State = httpReady when OnRequestDone is called? If so, this is not the case with 302. No becase OnRequestDone is called in different states. You have to put there a case statement. And when state is httpREady then you do next grab. But you where talking of Aboft metht in another mail. I think OnReqeustdone is also called when you call Abort if state is not yet httpReady. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, February 25, 2006, 17:46, Ronny wrote: That is the problem. This routine is called from OnRequestDone. That is why I think that there is a bug. OnRequestDone gets called twice for 302s, but I have already taken that into account. Should httpcli.State = httpReady when OnRequestDone is called? If so, this is not the case with 302. - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 11:22 AM Subject: Re: [twsocket] HttpCli problem Why use a loop ? Why don't you want to use OnRequestDone event ? -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: Ronny [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 4:57 PM Subject: Re: [twsocket] HttpCli problem I did find a work-around, but it is not pretty: while httpcli.State httpready do begin a:=a+1; log.Lines.add('Waiting '+inttostr(a)); application.ProcessMessages; end; This is only needed after a 302. The counter ranges from 400-1000 before the state turns to httpready. And I am not sure that they are real 302s. The same pages give a statuscode of 302 consistently when downloaded in the same order, but may give a 200 if downloaded in a different order. Could a bug in my program make httpcli give a fake 302 statuscode? (The above code gives an infinite loop if application.processmessages is removed) - Original Message - From: Ronny [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 10:08 AM Subject: Re: [twsocket] HttpCli problem The problem is that the STATE is not ready after the abort, so when I use httpcli to grab another file after a 302, I would get an error. (http component busy, I think). After an abort in such a case, is there anything that I have to do to make sure that the component is ready for the next use? (This only happens after a 302, anything else (200, 404, etc) works well.) -Ronny - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 3:59 AM Subject: Re: [twsocket] HttpCli problem After httpcli.abort is called, the statuscode is normally 404 if the statuscode before the call is 200. The statuscode is 0 if the original statuscode is 302. This is causing me problems (i.e. httpcli state is not ready after an abort is called if the statuscode was 302). See example: log.Lines.Add(inttostr(httpcli.StatusCode); httpcli.abort; log.Lines.Add(inttostr(httpcli.StatusCode); D7, ICS V6 beta V1.91 StatusCode value is valid only when or after OnRequestDone has been triggered. Anyway, if you abort, you obviously know what you are doing. No need to rely on StatusCode. -- [EMAIL PROTECTED] 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 -- 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 -- 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] ICS on Mac OS X
Hello, Or the dotNet version ? Mac can install Mono wich should be dotNet compatible. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Saturday, February 25, 2006, 17:23, Francois PIETTE wrote: is ICS working on Mac OS X with Freepascal? I've just booted Mac OS X for the first time in my life. Does Mac OS X support winsock and messaging ? I guess not. But probably the Kylix version would work since it only use unix sockets. -- [EMAIL PROTECTED] 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] HttpCli problem
Thank you for the feedback, Francois and Wilfried. I have not been clear in my explination. Let me start again with more detail: State: httpReady I call httpcli.GetASync. State: httpDnsLookup ( on HeaderEnd) State: httpWaitingHeader StatusCode: 302 I call httpcli.About State: httpReady (OnRequestDone) State: httpDNSLookup Nothing is done between OnHeaderEnd and OnRequestDone, so I assume that httpcli is looking for the redirect. (This only happens with a 302 StatusCode, with a 200 Statuscode, OnRequestDone state is httpReady). If this is a 'Feature' and not a bug, then can I Abort again in the OnRequestDone? Or what do you recommend? I do not think that the second DNSLookup will provide me with any useful information, even if it is a redirect, I wouldn't know how to use it, so I might as well cancel it and try to get the next file. - Original Message - From: Francois PIETTE [EMAIL PROTECTED] To: ICS support mailing twsocket@elists.org Sent: Saturday, February 25, 2006 1:12 PM Subject: Re: [twsocket] HttpCli problem Why use a loop ? Why don't you want to use OnRequestDone event ? That is the problem. This routine is called from OnRequestDone. That is why I think that there is a bug. OnRequestDone gets called twice for 302s, but I have already taken that into account. Should httpcli.State = httpReady when OnRequestDone is called? If so, this is not the case with 302. There is no reason to call Abort from OnRequestDone which is the time when the request is... done ! Why do you think you need to call Abort from OnRequestDone ? I you really have a good reason (I like to hear it), then PostMessage a custom message and then exit. Then from the corresponding event handler, call Abort. -- Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html -- [EMAIL PROTECTED] 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 -- 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] Problem with v6 BCB package
Hello, Despite all that I have done, the package that I created for BCB6 (http://www.fastream.com/ics/V6.zip) gives linker access violation. Anyone can help? Francois, the last time I asked for your help on this issue, you DENIED for no time and I hope you can just take a look at this package, fix and include in the original zip. Regards, SZ -- 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