Re: [api-dev] SimpleSystemMail
Alexandro Colorado wrote: > On Mon, 15 Oct 2007 10:20:20 -0500, Mathias Bauer <[EMAIL PROTECTED]> > wrote: > >> But why is Simple(System|Command)Mail not enough for you? Using it will >> create much less overhead and much less chances to stumble over bugs and >> errors. >> Ciao, >> Mathias > > Hi Mathias, > > Please correct me if I am wrong, but from my point of view all that > SimpleSystemMail do is call the system mail client and send whatever > information like to/from/ etc. I am not sure about SimpleSystemCommandMail > really do different. > > What I did with my python smtplib was sending an email without an email > client interaction which is what I need. This means that the email will > get there regardless if the user doesn't have a Pop3/IMAP account and uses > a Webmail account. Ah, I see what you mean. So yes, so then the mentioned service could be better. Unfortunately I don't know it it is possible to use it from Basic. IIRC Caolan McNamara ([EMAIL PROTECTED] should work) did the Python implementation and perhaps he can give you some tips. Alternatively, if sending a mail via Python is very easy someone could create another UNO service that just wraps the few Python calls with PyUno so that you can use it in Basic. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
On Mon, 15 Oct 2007 10:20:20 -0500, Mathias Bauer <[EMAIL PROTECTED]> wrote: But why is Simple(System|Command)Mail not enough for you? Using it will create much less overhead and much less chances to stumble over bugs and errors. Ciao, Mathias Hi Mathias, Please correct me if I am wrong, but from my point of view all that SimpleSystemMail do is call the system mail client and send whatever information like to/from/ etc. I am not sure about SimpleSystemCommandMail really do different. What I did with my python smtplib was sending an email without an email client interaction which is what I need. This means that the email will get there regardless if the user doesn't have a Pop3/IMAP account and uses a Webmail account. -- Alexandro Colorado CoLeader of OpenOffice.org ES http://es.openoffice.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
Alexandro Colorado wrote: > I guess that the function doesn't really do what I was expecting. I have a > different question now. I want to send an email from OpenOffice.org. Now I > am looking into another service in UNO which might do something similar > which is sending emails from UNO. > > http://api.openoffice.org/docs/common/ref/com/sun/star/mail/XSmtpService.html No, this is not a service, this is an interface (it starts with an "X"). > SmtpService is another service I am now looking into to be able to send an > email from OOo. Anyone have an input on this service? This service is used for the MailMerge functionality in OOo. It is implemented in Python. From what I can see in the implementation in Writer it is much harder to use and perhaps not usable in Basic as it seems to require that an object is passed to the service that must be implemented by the client software. But admittedly I concur that from a first glance. But why is Simple(System|Command)Mail not enough for you? Using it will create much less overhead and much less chances to stumble over bugs and errors. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
On Sun, 14 Oct 2007 18:31:03 -0500, Paolo Mantovani <[EMAIL PROTECTED]> wrote: Alle 13:36, sabato 13 ottobre 2007, Mathias Bauer ha scritto: Paolo Mantovani schrieb: > Regarding the problem that you mentioned in your follow-up I've just seen > that Mathias has alreadly answered. > I can only add that in the SnippetCreator wizard I've used the following > strategy: [] That's what I suggested, put into Basic source code. :-) True, actually I didn't add any useful information, I should have read your post more carefully :-) ciao Paolo M I guess that the function doesn't really do what I was expecting. I have a different question now. I want to send an email from OpenOffice.org. Now I am looking into another service in UNO which might do something similar which is sending emails from UNO. http://api.openoffice.org/docs/common/ref/com/sun/star/mail/XSmtpService.html SmtpService is another service I am now looking into to be able to send an email from OOo. Anyone have an input on this service? In python I have something similar by using the module smtplib which looks quite similar: http://pastebin.mozilla.org/219060 The smtpservice also includes a sendmail() method labeled: sendMailMessage() and MailServer(). Just need to clear this services and their function. http://api.openoffice.org/docs/common/ref/com/sun/star/mail/XSmtpService.html http://api.openoffice.org/docs/common/ref/com/sun/star/mail/XMailServer.html a somewhat different question, is it possible to call a python script from Basic? I am looking into the command: URL:service:es.openoffice.org.pyMail.SendEmail?execute -- Alexandro Colorado CoLeader of OpenOffice.org ES http://es.openoffice.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
Alle 13:36, sabato 13 ottobre 2007, Mathias Bauer ha scritto: > Paolo Mantovani schrieb: > > Regarding the problem that you mentioned in your follow-up I've just seen > > that Mathias has alreadly answered. > > I can only add that in the SnippetCreator wizard I've used the following > > strategy: [] > > That's what I suggested, put into Basic source code. :-) True, actually I didn't add any useful information, I should have read your post more carefully :-) ciao Paolo M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
Paolo Mantovani schrieb: > Regarding the problem that you mentioned in your follow-up I've just seen > that > Mathias has alreadly answered. > I can only add that in the SnippetCreator wizard I've used the following > strategy: > > > > 'try to obtain a mail service > oMailService = createUnoService("com.sun.star.system.SimpleSystemMail") > > If IsNull(oMailService) Then > oMailService = createUnoService("com.sun.star.system.SimpleCommandMail") > End If > > If IsNull(oMailService) Then > GoTo ErrH > End If > > That's what I suggested, put into Basic source code. :-) Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
Alexandro Colorado schrieb: > On Fri, 12 Oct 2007 12:55:51 -0500, Mathias Bauer <[EMAIL PROTECTED]> > wrote: > >> Hi Alexandro, >> >> Alexandro Colorado schrieb: >> >>> However I want to know if I would need a transport on my system so the >>> API >>> is able to send the email. This is a similar dilema that I face with >>> python's libsmtpd module which is capable of working as an smtpd server >>> but there is really not much reference about how to run it. >> >> The SimpleSystemMail service uses the system mail client to send mails. >> If you don't get one on your system you could try the >> "com.sun.star.system.SimpleCommandMail" service. At least that's the >> strategy the "Send document as mail" code in OOo uses. >> >> Ciao, >> Mathias >> > > > Thanks mathias, I wonder if this is actually generated from OOo or you > mean the $mail command in Unix. In other words is this SimpleComandMail > cross platform at all? Sorry, I don't know the internal details. What I can say is how we do it in the framework code: first ask for the SimpleSystemMail service and if you don't get one ask for the SimpleCommandMail service. This should work on all OOo installations where "Send document as mail" works. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
Hi Alexandro, Alle 09:36, giovedì 11 ottobre 2007, Alexandro Colorado ha scritto: > Hi Paolo, > > In Barcelona I asked you about the possibility of using SimpleSystemMail > uno service to be able to send email from OpenOffice.org. The only > reference I got to how it works is through the snippet on Andrew > Pitonyak's Macro Book. You can find another example in my SnippetCreator wizard (module DlgSnippet - Sub SnippetToEmail ) > Sub SendSimpleMail() >Dim vMailSystem, vMail, vMessage > >vMailSystem=createUnoService("com.sun.star.system.SimpleSystemMail") >vMail=vMailSystem.querySimpleMailClient() Regarding the problem that you mentioned in your follow-up I've just seen that Mathias has alreadly answered. I can only add that in the SnippetCreator wizard I've used the following strategy: 'try to obtain a mail service oMailService = createUnoService("com.sun.star.system.SimpleSystemMail") If IsNull(oMailService) Then oMailService = createUnoService("com.sun.star.system.SimpleCommandMail") End If If IsNull(oMailService) Then GoTo ErrH End If [] > However I want to know if I would need a transport on my system so the API > is able to send the email. This is a similar dilema that I face with > python's libsmtpd module which is capable of working as an smtpd server > but there is really not much reference about how to run it. I don't catch this point (but I must say that I'm not very acquainted with network things): Even if you run an smtpd server from Python, the API relies on an external mail client program for sending emails, therefore, the external mail client should be previously configured for using your local smtp server. So I don't see any advantages. ciao Paolo M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
On Fri, 12 Oct 2007 12:55:51 -0500, Mathias Bauer <[EMAIL PROTECTED]> wrote: Hi Alexandro, Alexandro Colorado schrieb: However I want to know if I would need a transport on my system so the API is able to send the email. This is a similar dilema that I face with python's libsmtpd module which is capable of working as an smtpd server but there is really not much reference about how to run it. The SimpleSystemMail service uses the system mail client to send mails. If you don't get one on your system you could try the "com.sun.star.system.SimpleCommandMail" service. At least that's the strategy the "Send document as mail" code in OOo uses. Ciao, Mathias Thanks mathias, I wonder if this is actually generated from OOo or you mean the $mail command in Unix. In other words is this SimpleComandMail cross platform at all? -- Alexandro Colorado CoLeader of OpenOffice.org ES http://es.openoffice.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
Hi Alexandro, Alexandro Colorado schrieb: > However I want to know if I would need a transport on my system so the API > is able to send the email. This is a similar dilema that I face with > python's libsmtpd module which is capable of working as an smtpd server > but there is really not much reference about how to run it. The SimpleSystemMail service uses the system mail client to send mails. If you don't get one on your system you could try the "com.sun.star.system.SimpleCommandMail" service. At least that's the strategy the "Send document as mail" code in OOo uses. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] SimpleSystemMail
On Thu, 11 Oct 2007 02:36:14 -0500, Alexandro Colorado <[EMAIL PROTECTED]> wrote: Hi Paolo, In Barcelona I asked you about the possibility of using SimpleSystemMail uno service to be able to send email from OpenOffice.org. The only reference I got to how it works is through the snippet on Andrew Pitonyak's Macro Book. Sub SendSimpleMail() Dim vMailSystem, vMail, vMessage vMailSystem=createUnoService("com.sun.star.system.SimpleSystemMail") vMail=vMailSystem.querySimpleMailClient() I might add that this script fails when I reach this line with an error message telling me that the object variable not set. Which leads me to believe that querySimpleMailClient is not returning anything to define vMail. 'You want to know what else you can do with this, see 'http://api.openoffice.org/docs/common/ref/com/sun/star/system/XSimpleMailMessage.html vMessage=vMail.createsimplemailmessage() vMessage.setrecipient("[EMAIL PROTECTED]") vMessage.setsubject("This is my test subject") 'Attachements are set by a sequence which in basic means an array 'I could use ConvertToURL() to build the URL! Dim vAttach(0) vAttach(0) = "file:///c|/macro.txt" vMessage.setAttachement(vAttach()) 'DEFAULTS Launch the currently configured system mail client. 'NO_USER_INTERFACE Do not show the interface, just do it! 'NO_LOGON_DIALOG No logon dialog but will throw an exception if one is required. vMail.sendSimpleMailMessage(vMessage, com.sun.star.system.SimpleMailClientFlags.NO_USER_INTERFACE) End Sub However I want to know if I would need a transport on my system so the API is able to send the email. This is a similar dilema that I face with python's libsmtpd module which is capable of working as an smtpd server but there is really not much reference about how to run it. What I am trying to achieve is the user be able to send a registration email to the Mailing list from within openoffice.org. Maybe this could help. -- Alexandro Colorado CoLeader of OpenOffice.org ES http://es.openoffice.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]