[Gambas-user] strange behaviour from commandline - empty mail attachments
I could build a client which prints a pdf from commandline and sends it to someone via e-mail, the Cairo class makes the pdfs. My Gambas program is called by cron. It checks a mailbox and reads the mails if any. These are contact forms. The data are then processed into a pdf and the resulting pdf sent back to the person which sent the contact form. The strange thing is, as long as I start the program by hand, everything runs as expected. But when it is started by cron, the pdfs which are sent back reach the recipient empty, i. e. 0 Bytes. Sending is achieved by an external Perl script named sendEmail, I shell out to start it. (This is because the SMTP client in Gambas doesn't want to send these mails via any of my providers, haven't found the reason yet.) But it doesn't seem to be this script's mistake. I tested the same pdf-file with a special version of the program which jumped directly into mail despatch, and when I started it from within the IDE, everything ran fine, but from cron it would send 0 byte pdfs. This is slightly OT, but it might have to do with the way Gambas handles Shells or file rights or something completely different... Does anyone here have an idea? Rolf -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] strange behaviour from commandline - empty mail attachments
On Thu, 2013-08-15 at 12:07 +0200, Rolf-Werner Eilert wrote: I could build a client which prints a pdf from commandline and sends it to someone via e-mail, the Cairo class makes the pdfs. My Gambas program is called by cron. It checks a mailbox and reads the mails if any. These are contact forms. The data are then processed into a pdf and the resulting pdf sent back to the person which sent the contact form. The strange thing is, as long as I start the program by hand, everything runs as expected. But when it is started by cron, the pdfs which are sent back reach the recipient empty, i. e. 0 Bytes. Sending is achieved by an external Perl script named sendEmail, I shell out to start it. (This is because the SMTP client in Gambas doesn't want to send these mails via any of my providers, haven't found the reason yet.) But it doesn't seem to be this script's mistake. I tested the same pdf-file with a special version of the program which jumped directly into mail despatch, and when I started it from within the IDE, everything ran fine, but from cron it would send 0 byte pdfs. This is slightly OT, but it might have to do with the way Gambas handles Shells or file rights or something completely different... Does anyone here have an idea? Rolf Hi Rolf, The first thing I'd be looking at is your working directories, I presume you are using temporary files somewhere. Don't forget that the cron daemon is running in a completely different environment to your User environment. hth Bruce -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] strange behaviour from commandline - empty mail attachments
Am 15.08.2013 12:25, schrieb Bruce: On Thu, 2013-08-15 at 12:07 +0200, Rolf-Werner Eilert wrote: I could build a client which prints a pdf from commandline and sends it to someone via e-mail, the Cairo class makes the pdfs. My Gambas program is called by cron. It checks a mailbox and reads the mails if any. These are contact forms. The data are then processed into a pdf and the resulting pdf sent back to the person which sent the contact form. The strange thing is, as long as I start the program by hand, everything runs as expected. But when it is started by cron, the pdfs which are sent back reach the recipient empty, i. e. 0 Bytes. Sending is achieved by an external Perl script named sendEmail, I shell out to start it. (This is because the SMTP client in Gambas doesn't want to send these mails via any of my providers, haven't found the reason yet.) But it doesn't seem to be this script's mistake. I tested the same pdf-file with a special version of the program which jumped directly into mail despatch, and when I started it from within the IDE, everything ran fine, but from cron it would send 0 byte pdfs. This is slightly OT, but it might have to do with the way Gambas handles Shells or file rights or something completely different... Does anyone here have an idea? Rolf Hi Rolf, The first thing I'd be looking at is your working directories, I presume you are using temporary files somewhere. Don't forget that the cron daemon is running in a completely different environment to your User environment. hth Bruce Yes, this is something I suspected, but I cannot imagine what should be wrong. I only give complete paths to the programs, cron starts the Gambas app under my rights, and it is running as expected up to the point where the helper script is to upload the pdf file. Another point: There is a file for the mail body text which is formed by the Gambas app before calling the external script, and the script reads it and inserts it into the mail properly. Rights are 644 for all files. So why does the script send an empty pdf then? In the logs, there is nothing which would point to a refused file. The provider takes and acknowledges receipt of it. So the only thing I could think of is that the script indicates the name of the file xyz.pdf but never sends any data for it, then simply says that's it. So, what could cause the script to overlook one file and accept another? Rolf -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] strange behaviour from commandline - empty mail attachments
Am 15.08.2013 12:25, schrieb Bruce: On Thu, 2013-08-15 at 12:07 +0200, Rolf-Werner Eilert wrote: I could build a client which prints a pdf from commandline and sends it to someone via e-mail, the Cairo class makes the pdfs. My Gambas program is called by cron. It checks a mailbox and reads the mails if any. These are contact forms. The data are then processed into a pdf and the resulting pdf sent back to the person which sent the contact form. The strange thing is, as long as I start the program by hand, everything runs as expected. But when it is started by cron, the pdfs which are sent back reach the recipient empty, i. e. 0 Bytes. Sending is achieved by an external Perl script named sendEmail, I shell out to start it. (This is because the SMTP client in Gambas doesn't want to send these mails via any of my providers, haven't found the reason yet.) But it doesn't seem to be this script's mistake. I tested the same pdf-file with a special version of the program which jumped directly into mail despatch, and when I started it from within the IDE, everything ran fine, but from cron it would send 0 byte pdfs. This is slightly OT, but it might have to do with the way Gambas handles Shells or file rights or something completely different... Does anyone here have an idea? Rolf Hi Rolf, The first thing I'd be looking at is your working directories, I presume you are using temporary files somewhere. Don't forget that the cron daemon is running in a completely different environment to your User environment. hth Bruce I quickly browsed through the Perl script, and there are error messages in case it cannot read the attachment. I'm not that intimate with Perl, but I still suspect the Shell mechanisms of Gambas to confuse the script. Rolf -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] SMTP client doesn't want
Ok folks, here's my other thread about gb.net.smtp. I want to send an e-mail with an attachment. The MTA is my German Telecom provider t-online, so I use my name as sender and log in. The guys use STARTTLS as far as I know. When I use TLS, I get an authentication failed. When I use SSL, it only says - quit nothing ever happens. Do you see anything missing here: mail.From = eilert-sprac...@t-online.de mail.To.Add(feld[1]) 'recipient's e-mail mail.Subject = Ihre E-Mail mail.Add(Application.Path / mdatei) 'message body mail.Add(Application.Path / feld[0]) 'attachment: pdf-file mail.Host = securesmtp.t-online.de mail.Port = 587 mail.Encrypt = Net.TLS 'also tried Net.SSL mail.User = username mail.Password = password mail.Debug = True mail.Send() Thanks for your help... Rolf -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas-user Digest, Vol 87, Issue 24
From: Beno?t Minisini gam...@users.sourceforge.net Le 13/08/2013 18:54, PICCORO McKAY Lenz a ?crit : i noted also that in debian there are two devel packages from curl: libcurl4-gnutls-dev libcurl4-openssl-dev 1) agains what flavor must be complied gambas? i said clearly in previously mqails that i have curl 7.18.2, docs said 7.13 , (and many others out of date?) 2) and again? also does need curl enabled async DNS querys with lib c-ares? CC gb_net_curl_la-CNet.lo CNet.c:65: error: ?CURLAUTH_DIGEST_IE? no se declar? aqu? (no en una funci?n) CNet.c:146: error: ?CURLE_SSL_CRL_BADFILE? no se declar? aqu? (no en una funci?n) CNet.c:147: error: ?CURLE_SSL_ISSUER_ERROR? no se declar? aqu? (no en una funci?n) make[5]: *** [gb_net_curl_la-CNet.lo] Error 1 and about that: Why are your mails full of unreadable characters? seems sourge force or icecat cannot process latin UTF8 chars, my locale are es_VE.UTF8 so i'm on right.. the mail must be fixed or i must fix the icecat -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas-user Digest, Vol 87, Issue 24
Le 15/08/2013 14:39, PICCORO McKAY Lenz a écrit : From: Beno?t Minisini gam...@users.sourceforge.net Le 13/08/2013 18:54, PICCORO McKAY Lenz a ?crit : i noted also that in debian there are two devel packages from curl: libcurl4-gnutls-dev libcurl4-openssl-dev 1) agains what flavor must be complied gambas? i said clearly in previously mqails that i have curl 7.18.2, docs said 7.13 , (and many others out of date?) Can you send run curl --version and send me the output? -- Benoît Minisini -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Gambas-user Digest, Vol 87, Issue 24
Le 15/08/2013 15:30, Benoît Minisini a écrit : Le 15/08/2013 14:39, PICCORO McKAY Lenz a écrit : From: Beno?t Minisini gam...@users.sourceforge.net Le 13/08/2013 18:54, PICCORO McKAY Lenz a ?crit : i noted also that in debian there are two devel packages from curl: libcurl4-gnutls-dev libcurl4-openssl-dev 1) agains what flavor must be complied gambas? i said clearly in previously mqails that i have curl 7.18.2, docs said 7.13 , (and many others out of date?) Can you send run curl --version and send me the output? Can you send me your '/usr/include/curl/curl.h' file too? Thanks! -- Benoît Minisini -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Feature request: Use key- (and index-)accessor in a With clause
Le 13/08/2013 01:31, Benoît Minisini a écrit : Le 11/08/2013 13:33, Tobias Boege a écrit : Hi Benoit, what bothers me from time to time is that With is *so* handy but can't be used to access Array or Collection elements like: With hCollection ' or hArray Print [key] ' or Print [0] End With I see that this would be a syntactical problem because [key] and [0] may equivalently well be recognised as inline arrays. But we have another option, right? There is still the ! operator which is unambiguous: With hCollection Print !key End With Should be no problem if implemented. What do you think? And while we are at it, couldn't the ! operator at the same time get the capability to support integers, so that the above will also work with an array: With hArray Print !0 End With Regards, Tobi The '!' can't be used, because a!b is just syntactic sugar for a[b]. Maybe a syntax like .[x] = y could be used, as at the moment .[x] is a syntax error... I will think about it. This is implemented in revision #5797: Dim aStr As New String[2] With aStr .[0] = a .[1] = b Print .[0];; .[1] End With Enjoy! -- Benoît Minisini -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Feature request: Use key- (and index-)accessor in a With clause
On Thu, 15 Aug 2013, Beno?t Minisini wrote: Le 13/08/2013 01:31, Beno?t Minisini a ?crit : Le 11/08/2013 13:33, Tobias Boege a ?crit : Hi Benoit, what bothers me from time to time is that With is *so* handy but can't be used to access Array or Collection elements like: With hCollection ' or hArray Print [key] ' or Print [0] End With I see that this would be a syntactical problem because [key] and [0] may equivalently well be recognised as inline arrays. But we have another option, right? There is still the ! operator which is unambiguous: With hCollection Print !key End With Should be no problem if implemented. What do you think? And while we are at it, couldn't the ! operator at the same time get the capability to support integers, so that the above will also work with an array: With hArray Print !0 End With Regards, Tobi The '!' can't be used, because a!b is just syntactic sugar for a[b]. Maybe a syntax like .[x] = y could be used, as at the moment .[x] is a syntax error... I will think about it. This is implemented in revision #5797: Dim aStr As New String[2] With aStr .[0] = a .[1] = b Print .[0];; .[1] End With Enjoy! Nice! Works also with Collection-like objects. The only thing I noticed was that it's not very comfortable to type in the IDE, i.e. once you are in the With clause and type ., you will presented the list of symbols in the auto-completion popup. If you press [, the first thing in there is inserted before the [. Anyway, this is very great! Thanks, Tobi -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Feature request: Use key- (and index-)accessor in a With clause
Le 15/08/2013 16:32, Tobias Boege a écrit : This is implemented in revision #5797: Dim aStr As New String[2] With aStr .[0] = a .[1] = b Print .[0];; .[1] End With Enjoy! Nice! Works also with Collection-like objects. The only thing I noticed was that it's not very comfortable to type in the IDE, i.e. once you are in the With clause and type ., you will presented the list of symbols in the auto-completion popup. If you press [, the first thing in there is inserted before the [. Anyway, this is very great! Thanks, Tobi Yep, the IDE is not yet aware of that new syntax... In revision #5798, I implemented the same thing for the ! operator. With some Result object or Collection !field1 = foo !field2 = bar End With Regards, -- Benoît Minisini -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] How to share one datasource across two forms?
Le 11/08/2013 21:27, Marty a écrit : Hello, First let me say thank you to all those who have answered my past posts. As I get deeper into programming databases with Gambas, more questions come out. I have two forms which show data from the same table. The data is split up so that the user interface is less confusing. My first question is how can I show the data on form 2 when the datasource is on form 1? You can't share a DataSource between two different forms, because DataSource is also a control container. But, technically, I could have add a way to specify the DataSource of a control explicitely... I'd like to use a datacombo box to provide input to a field but, get the list from another table. Is this possible? DataCombo takes its contents from another table, provided that it shares a common primary key with the main table. See the documentation of DataCombo.Table, DataCombo.Field and DataCombo.Display. One more. I also need a data aware checkbox. I want to save the logical value of the checkbox to the datasource. Any suggestions? You must implement it by hand at the moment. I didn't implement DataCheckBox, because a database boolean field actually understands three value: True, False and Null. Maybe I could use the Tristate property... I will think about it. Regards, -- Benoît Minisini -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Feature request: Use key- (and index-)accessor in a With clause
On Thu, 15 Aug 2013, Beno?t Minisini wrote: Le 15/08/2013 16:32, Tobias Boege a ?crit : This is implemented in revision #5797: Dim aStr As New String[2] With aStr .[0] = a .[1] = b Print .[0];; .[1] End With Enjoy! Nice! Works also with Collection-like objects. The only thing I noticed was that it's not very comfortable to type in the IDE, i.e. once you are in the With clause and type ., you will presented the list of symbols in the auto-completion popup. If you press [, the first thing in there is inserted before the [. Anyway, this is very great! Thanks, Tobi Yep, the IDE is not yet aware of that new syntax... In revision #5798, I implemented the same thing for the ! operator. With some Result object or Collection !field1 = foo !field2 = bar End With Yes, everything works perfectly. The IDE now, too. Thank you very much. Regards, Tobi -- Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with 2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031iu=/4140/ostg.clktrk ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user