Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
140 user(s) are online (106 user(s) are browsing Forums)

Members: 0
Guests: 140

more...

Headlines

 
  Register To Post  

C:UrlOpen
Quite a regular
Quite a regular


See User information
Hi,

Normally when you specify a mailto url, you do so like this:

mailto:info@example.com?subject=test&body=hello!

Now, URLOpen seems to have a different syntax:

URLOpen mailto:info@example.com subject=test

This works for SimpleMail, but is it possible to specify body text?

EDIT:

IDEALLY I want to use OpenURL, but SimpleMail won't even open even though it is enabled.

Go to top
Re: C:UrlOpen
Just popping in
Just popping in


See User information
At the moment URLOpen simply passes your command line to
the client as is.

The individual client must accept the keywords you use
as a command template and the commands must be formatted
the same way you would use it as a shell command that
calls ReadArgs() to get the arguments parsed.

If the client does not respond when invoking it from a
shell, then urlopen can't use it.

Try typing; Appdir:SimpleMail ?
to see what option it supports, I don't have it here to
see, however, I did a quick test with YAM with the
following line works;

urlopen mailto=info@example.com subject="The subject" attach=temp:domains.html

PS:
YAM doesn't appear to have a "Body" keyword, but it does
have a "Letter" keyword, however it doesn't appear to work
on the version of YAM I have here for some reason.


Go to top
Re: C:UrlOpen
Home away from home
Home away from home


See User information
@djrikki

The problem is that most of the email client we have if not all do not parse mailto: urls.

Then URLOpen just passes the url onto the client. Add to that YAM at least doesn't parse it;s command line if it's allready started it just brings the YAM screen tofront.

So I have just added a new client to my URLOpen prefs which is a rexxscript to parse the url and open YAM accordingly.

/* email.rexx - Send mail from your web browser using YAM               */

PARSE ARG email'?' junk
PARSE ARG junk 
'subject='subject'&' junk
PARSE ARG junk 
'body='body'&' junk

IF ~SHOW('Ports','YAM'THEN
  ADDRESS COMMAND 
'Run <>NIL: YAM:YAM NOCHECK MAILTO 'email' SUBJECT 'subject
ELSE DO
  
ADDRESS YAM
  Show
  MailWrite
  WriteTo email
  
'WriteSubject "'subject'"'
  'WriteEditor  "TEXT ' 
|| body || '"'
END


You could easily write the eqivalent for SimpleMail.

TO be really robust it would need to add a urldecode function in case any of the sections of the url are escaped wwith %20 for space etc etc.

[edit]To be really really robust it would need to reencode an newlines in the body section with '*N' so that readargs doesn't terminate the command line at the newline.


Edited by broadblues on 2012/3/18 11:02:31
Go to top
Re: C:UrlOpen
Home away from home
Home away from home


See User information
@Colin

LETTER does work I think but it doesn't do what you think, in fact it loads a file into the editor.


Go to top
Re: C:UrlOpen
Quite a regular
Quite a regular


See User information
So basically its far from straightforward.

I need a system that will work regardless of what email client the user's prefers.

Its for Jack, one of the options presented to the user is:

'Tell a Friend'

Which opens up the user's email client, I wanted to populate the message box.

I'll just send the message to the subject field instead. It'll have to be just a plain and simple URL instead - the user will just have to Cut and Paste it into the message box themselves.

Go to top
Re: C:UrlOpen
Quite a regular
Quite a regular


See User information
@djrikki
Quote:
I need a system

I suppose you're digging in the wrong hole here - it's not "the system" that fails here, but the application. As long as not all mail clients/web browsers etc. use a common command line template or at least show analog keywords to the cli, the OS can't do much about it.

In principle broadblues' ARexx script is more or less exactly that: a common cli template that translates the input for the different needs of each client. You might bugger the authors of SimpleMail and YAM to change their applications. But be warned: A lot of older user scripts may fail afterwards - which will generate new moanings...

X1000|II/G4|440ep|2000/060|2000/040|1000
Go to top
Re: C:UrlOpen
Just popping in
Just popping in


See User information
@cha05e90

Simplemail and YAM share the same commandline arguments: MAILTO and SUBJECT. The Arexx interface is a little bit different.

Go to top
Re: C:UrlOpen
Home away from home
Home away from home


See User information
Quote:

Simplemail and YAM share the same commandline arguments: MAILTO and SUBJECT. The Arexx interface is a little bit different.


Yes but as I said YAM doesn't parse it command line on the second launch YAM it just brings the existing copy to front. Thus some kind of Rexx (or other script language) wrapper is needed.

The difference between the mail clients and the webrowers we have is that the webrowsers handke URIsS and the email clients don't this makes using a mailto URI as a way to build a message tricky.



Go to top
Re: C:UrlOpen
Just popping in
Just popping in


See User information
It is quite possible for me to add a command parser for the
mailto protocol in launch-handler, with separate %tokens
for the different components, so the individual programs
differences can be catered for, but at the time there was simply no
call for anything more elaborate than starting the client
and passing the email address.

Also, as "broadblues" indicated, there is no reason you
can't simply execute a Shell or Arexx script from the URL prefs,
I already use a shell script to start the new beta version
of TimberWolf, as it must be started from a script ATM.

It's a tad off topic, but here's what I use for that...

Copy between the ==== lines below and paste it into
notepad, save the file as S:TW and set the "+s" bit by
typing this in a shell; protect S:TW +s


;======================================
.bra {
.ket }
.key "OPTIONS/F"
;$VER: Start Timberwolf script 53.1 (20.02.2012)

stack 50000
if exists ${appdir/timberwolf-bin}/timberwolf
cd ${appdir/timberwolf-bin}
run Execute >nil: <nil: *>nil: timberwolf {OPTIONS}
else
RequestChoice ERROR "Can't find Timberwolf Dir.*NPlease start it from icon at least once." GADGETS=OK
endif
;======================================


Then create a new entry for the required protocols
(www,http,https) in the URL prefs and put "S:TW"
(without the quotes) in the client path field.
Give it the name TimberWolf in the client name field,
and the appropriate commandline format like the others.

Enjoy...


Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project