List Info

Thread: SimpleSystemMail




SimpleSystemMail
user name
2007-10-11 02:36:14
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.SIMPL
ESYSTEMMAIL")
   VMAIL=VMAILSYSTEM.QUERYSIMPLEMAILCLIENT()
   'YOU WANT TO KNOW WHAT ELSE YOU CAN DO WITH THIS, SEE
  
'HTTP://API.OPENOFFICE.ORG/DOCS/COMMON/REF/COM/SUN/STAR/SYST
EM/XSIMPLEMAILMESSAGE.HTML
   VMESSAGE=VMAIL.CREATESIMPLEMAILMESSAGE()
   VMESSAGE.SETRECIPIENT("ANDREW.PITONYAKQWEST.COM")
   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.ORG21

------------------------------------------------------------
---------
TO UNSUBSCRIBE, E-MAIL: DEV-UNSUBSCRIBEAPI.OPENOFFICE.ORG
FOR ADDITIONAL COMMANDS, E-MAIL: DEV-HELPAPI.OPENOFFICE.ORG


Re: SimpleSystemMail
user name
2007-10-11 15:58:14
ON THU, 11 OCT 2007 02:36:14 -0500, ALEXANDRO COLORADO  
<JZAOPENOFFICE.ORG> 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.SIMPL
ESYSTEMMAIL")
>    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/SYST
EM/XSIMPLEMAILMESSAGE.HTML
>    VMESSAGE=VMAIL.CREATESIMPLEMAILMESSAGE()
>    VMESSAGE.SETRECIPIENT("ANDREW.PITONYAKQWEST.COM")
>    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: DEV-UNSUBSCRIBEAPI.OPENOFFICE.ORG
FOR ADDITIONAL COMMANDS, E-MAIL: DEV-HELPAPI.OPENOFFICE.ORG


Re: SimpleSystemMail
user name
2007-10-12 12:55:51
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/Gu
llFOSS
Please don't reply to "nospamformbagmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: SimpleSystemMail
user name
2007-10-12 18:24:44
On Fri, 12 Oct 2007 12:55:51 -0500, Mathias Bauer
<nospamforMBAgmx.de>  
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: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: SimpleSystemMail
user name
2007-10-12 19:31:47
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.SIMPL
ESYSTEMMAIL")
>    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&
quot;)

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: DEV-UNSUBSCRIBEAPI.OPENOFFICE.ORG
FOR ADDITIONAL COMMANDS, E-MAIL: DEV-HELPAPI.OPENOFFICE.ORG


Re: SimpleSystemMail
user name
2007-10-13 06:34:49
Alexandro Colorado schrieb:

> On Fri, 12 Oct 2007 12:55:51 -0500, Mathias Bauer
<nospamforMBAgmx.de>  
> 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/Gu
llFOSS
Please don't reply to "nospamformbagmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: SimpleSystemMail
user name
2007-10-13 06:36:14
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&
quot;)
> 
> 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/Gu
llFOSS
Please don't reply to "nospamformbagmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: SimpleSystemMail
user name
2007-10-14 18:31:03
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: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: SimpleSystemMail
user name
2007-10-14 23:30:49
On Sun, 14 Oct 2007 18:31:03 -0500, Paolo Mantovani
<p_mantolibero.it>  
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/comm
on/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.mo
zilla.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/comm
on/ref/com/sun/star/mail/XSmtpService.html
http://api.openoffice.org/docs/commo
n/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: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: SimpleSystemMail
user name
2007-10-15 10:20:20
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/comm
on/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/Gu
llFOSS
Please don't reply to "nospamformbagmx.de".
I use it for the OOo lists and only rarely read other mails
sent to it.

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-10] [11-12]

about | contact  Other archives ( Real Estate discussion Medical topics )