Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Outlook

4 views
Skip to first unread message

Benny Pedersen

unread,
Apr 24, 2002, 11:56:45 PM4/24/02
to

"John McGrath [TeamB]" <ng...@JPMcGrath.net> wrote news:MPG.172f6f65b...@newsgroups.borland.com...
> On Tue, 23 Apr 2002 17:52:14 +0100, Shaun wrote:
>
> > Is there a way of opening just the 'send mail' window, i am
> > trying to create the same effect as clicking on a 'mailto'
> > link in a browser. Also can i send parameters to the window
> > such as: to, from, subject etc..
>
> Java has no API in it to open a mail window using the default mail
> client. The idea of a default mail client is something that does
> not exist on many systems, so it is not surprising that Java does
> not support the concept.
>
> The JavaMail API will allow you to send mail in a system independent
> fashion, but you would have to write the code to display a window,
> allow the user to create a message, etc. Once you have constructed a
> message, JavaMail will send it for you. More on JavaMail is available
> at: http://java.sun.com/products/javamail/index.html
>
> If you want to launch the default mail client, or do anything else that
> is system dependent like this, you will have to resort to some form of
> native code. That leaves two choices: accessing a native library
> using JNI or running a native program using Runtime exec().
>
> In this case, if you want to launch the default mail client under
> Windows only, you can do this using Runtime exec(), subject to possible
> security restrictions. Windows has a program for launching an
> arbitrary URL and you can run it using Runtime exec().
>
> Runtime.getRuntime().exec(
> new String[] {
> "rundll32",
> "url.dll,FileProtocolHandler",
> "mailto:sh...@shaun.com"
> + "?cc=postm...@shaun.com"
> + "&bcc=ab...@shaun.com"
> + "&subject=Hello%20Shaun"
> + "&body=This%20is%20the%20body."
> + "%0AThe%20End."
> }
> );
>
> --
> Regards,
>
> John McGrath [TeamB]
>
> ---------------------------------------------------
> Before sending me e-mail, please read:
> http://www.JPMcGrath.net/newsgroups/e-mail.html


<!-- Hi,

Below is two different solutions.

Benny Pedersen,
PS. JavaScript and MS-DOS
-->

<html><head><title>E-MAIL</title><script language="JavaScript">
m=" Hit any mouse or press a lowercase [a] or [b] ";i="0";
s="";function t(){s=s+m.charAt(i);document.title=s+m.charAt(i);i++;
if(i==m.length){i="0";s=""};setTimeout("t()","160")}window.onload=t
document.onkeypress=j;function j(){{if(event.keyCode==97)
window.location="#a"}{if(event.keyCode==98)window.location="#b"}{if
(event.keyCode<=96)
window.location="http://users.cybercity.dk/~bse26236/home.html"}}
</script>
<style type=
"text/css">a:hover{color:#333333; background-color:#ffffff;
}body{SCROLLBAR-FACE-COLOR:#333333;
SCROLLBAR-TRACK-COLOR:#c0c0c0; SCROLLBAR-ARROW-COLOR:#ffffff;
SCROLLBAR-3DLIGHT-COLOR:#333333;SCROLLBAR-HIGHLIGHT-COLOR:#ffffff;
SCROLLBAR-DARKSHADOW-COLOR:#333333; SCROLLBAR-SHADOW-COLOR:#ffffff;
}.MS-DOS{font-family: "Andale Mono", courier; font-size:100%}</style>
</head> <body bgcolor="#333333" text="#ffffff" alink="#ffffff"
link="#ffffff" vlink="#ffffff">
<br><b>Links: <a href="#a">Solution A</a>, <a href="#b">Solution B</a>
</b><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><hr>
<a name="a"></a>
<br><u><b>Solution A:</b></u>
<br><br>Here: &nbsp;[&nbsp;<a href="
mailto:@
?cc=@
&bcc=@
&subject=Hello%20
&body=%20%20How%20are%20you.
%0A%0A%20%20Blah%20Blah%20Blah...
%0A%0A%20%20Signature,%0A%20%20Reply%20to:%20mail%40post.com%0A
">e-mail</a>&nbsp;]
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><hr>
<a name="b"></a>
<br><u><b>Solution B:</b></u>
<br><br>Copy &amp; paste the following DOS batch code (from within
your browser)!
<br>Create a new text file named &quot;POST.BAT&quot;. To use the
demo, double click the batch file.
<br>
<span class="MS-DOS">
<br>@echo off
<br>if not exist &quot;nul&quot; for %%_ in (ech
got) do %%_o:EOF [to old DOS ver]
<br>echo&gt;%temp%.\~.EML
To:som...@somewhere.com;ano...@somebodyElse.com
<br>for %%e in (:subject:Files :X-Unsent:1/ :) do
echo%%e&gt;&gt;%temp%.\~.eml
<br>echo&gt;&gt; %temp%.\~.eml Hello,
<br>for %%e in (ver dir:%windir%\command\edit.com) do
%%e&gt;&gt;%temp%.\~.eml
<br>echo.&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;%temp%.\~.eml
<br>echo -- Below is the contents of c:\autoexec.bat&gt;&gt; &nbsp;
&nbsp; %temp%.\~.eml
<br>type c:\autoexec.bat &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&gt;&gt; &nbsp;
&nbsp; %temp%.\~.eml
<br>echo.&gt;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;%temp%.\~.eml
<br>echo -- Below is the contents of &quot;c:\config.sys&quot;&gt;&gt;
&nbsp; &nbsp; %temp%.\~.eml
<br>copy /b &gt; nul &nbsp; &nbsp; %temp%.\~.eml + c:\config.sys
&nbsp; &nbsp; &nbsp; &nbsp;%temp%.\~.eml
<br>for %%e in (&quot;start.exe /wait&quot; &quot;del /p&quot; cls)
do %%e &nbsp; &nbsp; %temp%.\~.eml
<br>:EOF
<br>
</span>
<br>Caution:
<br>Since a copy paste from the above text would
append a single space to each end of all the
<br>lines, then the created file won't work.
Solution: Copy the text from the below textarea.
<p align=center><textarea rows=5 cols=70>
@echo off
if not exist "nul" for %%_ in (ech got) do %%_o:EOF [to old DOS ver]
echo>%temp%.\~.EML To:som...@somewhere.com;ano...@somebodyElse.com
for %%e in (:subject:Files :X-Unsent:1/ :) do echo%%e>>%temp%.\~.eml
echo>> %temp%.\~.eml Hello,
for %%e in (ver dir:%windir%\command\edit.com) do %%e>>%temp%.\~.eml
echo.>> %temp%.\~.eml
echo -- Below is the contents of c:\autoexec.bat>> %temp%.\~.eml
type c:\autoexec.bat >> %temp%.\~.eml
echo.>> %temp%.\~.eml
echo -- Below is the contents of "c:\config.sys">> %temp%.\~.eml
copy /b > nul %temp%.\~.eml + c:\config.sys %temp%.\~.eml
for %%e in ("start.exe /wait" "del /p" cls) do %%e %temp%.\~.eml
:EOF
</textarea></p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p></body></html>

Dr John Stockton

unread,
Apr 25, 2002, 5:55:59 AM4/25/02
to
JRS: In article <ybLx8.1$td2...@news.get2net.dk>, seen in
news:alt.msdos.batch, Benny Pedersen <b.ped...@get2net.dk> wrote at
Thu, 25 Apr 2002 05:56:45 :-
>
>"John McGrath [TeamB]" <ng...@JPMcGrath.net> wrote news:MPG.172f6f65b3a6bfdd98b57
>f...@newsgroups.borland.com...

>> On Tue, 23 Apr 2002 17:52:14 +0100, Shaun wrote:
>>
>> > Is there a way of opening just the 'send mail' window, i am

The Borland newsgroups are intended to be served only by the Borland
server, and not distributed by the Usenet system. The Borland experts
(such as TeamB) only access them via the Borland server.

Unfortunately, one or more misbegotten sites copy from Borland into
Usenet distribution, and some allow posting.

So, Benny, your post, which was sent using (I believe) your usual
server, is more or less the equivalent of whispering in the back of the
classroom ...

See below. & s/b/B/.

NGs transposed, to enable posting to Usenet mechanism via my ISP.

--
© John Stockton, Surrey, UK. j...@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
For news:borland.*, use their server newsgroups.borland.com ; but first read
Guidelines <URL:http://www.borland.com/newsgroups/guide.html> very carefully.

Benny Pedersen

unread,
Apr 25, 2002, 8:31:18 PM4/25/02
to

"Dr John Stockton" <sp...@merlyn.demon.co.uk> wrote news:w3AARqMv...@merlyn.demon.co.uk...

Thanks.

Yes I accidental just found that Newsgroup and used my usual server.
I don't hope that I did something wrong.

I have created a link to the above e-mail topic, here:
http://users.cybercity.dk/~bse26236/batutil/GARBAGE.HTM#btw

Benny Pedersen.

0 new messages