Solved

How to send in Java Applet like from Netscape

Posted on 1997-11-03
8
193 Views
Last Modified: 2012-06-21
Hi,

We use a gateway product to send faxes from Email clients.

It works fine with Netscape Communicator.

When we want to send a fax to number 0123456789, we put the following address:

0123456789 <faxmaker@test.fr>

How can we do the same with an applet client ?

Thank you in advance

Renaud
0
Comment
Question by:hilleret
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 4

Expert Comment

by:rembo
ID: 1229903

I would imagine that you are doing this using a CGI
script and a POST from an HTML form.

So, you can do the following from a Java applet:

showDocument("http://" + getCodeBase.getHost() + "/cgi-bin/cginame?number="+phonetext.getText()+"&"host="+hosttext.getText());

This will call the cgi script cginame (replace name with
your CGI script) with the text out of two text fields
phonetext and hosttext which should contain the phone
numbers entered by the user.

That should do it.  Hope that helps,

-Tony


0
 
LVL 2

Author Comment

by:hilleret
ID: 1229904
Sorry, but we do not send messages with a CGI.

We use a product call IntranetFax from GFIFax that transforms Emails to faxes.

Renaud
0
 
LVL 5

Expert Comment

by:fontaine
ID: 1229905
To do what you need, you have to set up a mail server on the same machine as the Web server that will deliver the applet (this is due to applet security restrictions) and write a Java applet that acts as a mail client. The user will enter the data into the applet, that will send a mail to the mailbox your tool uses. It will then turn the mail to a fax, as usual. If your tool acts in fact as a mail server dedicated to sending faxes, you don't need to install a new mail server but simply to install your tool on the same machine as the Web server. Hereafter an example of Java applet that acts as a mail client (with source code):

http://www.chez.com/vasile/mail25/VasSendMail.html

It should be quite straigthforward to customize that code to your needs. You should also find a library to send mails from an applet at the www.gamelan.com site.

Bertrand

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:fontaine
ID: 1229906
To complete my answer: at the www.gamelan.com site, type the keywords "mail" and "smtp" into the search engine query, you will have plenty of resources.
0
 
LVL 2

Author Comment

by:hilleret
ID: 1229907
Peut-etre pourrions-nous parler français ???

Ma question porte uniquement sur la maniere de spécifier l'adresse Email précédée du numero de fax dans un applet Java !

Merci

A+

Renaud

0
 
LVL 5

Expert Comment

by:fontaine
ID: 1229908
Renaud, je ne comprends plus ta question. L'applet que je te propose permettent l'envoi de mails comme si tu te trouvais en face de ton client mail, il n'y a aucune difference.Ton probleme est-il un probleme d'interface utilisateur, ou as-tu deja ecrit un applet sans pouvoir le faire fonctionner, ou????
0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1229909
If IntranetFax supports OLE automation, there is another way you could solve your problem.
0
 
LVL 1

Accepted Solution

by:
toml032697 earned 200 total points
ID: 1229910
I don't know if this is usefull for you, as people has proposed where you can find information about SMTP, etc. But I extracted a some code from my e-mail applet which communicates with a SMTP server. This code will throw a security exception in Netscape if it is connected to another server than which it came from. If it is signed and UniversalConnect is enabled then you can connect to a third part otherwise not.

public void send() {
  try {
    // Open connection to SMTP server
    socket=new Socket(mailServer,port);

    in=new DataInputStream(socket.getInputStream());
    out=new PrintStream(socket.getOutputStream());

    // Send message
    sendline("HELO "+socket.getInetAddress().getHostName());
    sendline("MAIL FROM: "+userEmail);
    sendline("RCPT TO: 0123456789 <faxmaker@test.fr>");
    sendline("DATA");

    out.print("Subject: "+subject+"\n");
    StringTokenizer st=new StringTokenizer(message,"\n");
    while(st.hasMoreTokens()) {
      String s=st.nextToken();
      if(s.startsWith("."))
        out.print(".");
        out.print(s+"\n");
      }
      out.print("\r\n");
      sendline(".");

      // Close connection
      socket.close();
    } catch(Exception e) {
      System.out.println(e);
  }
}

void sendline(String data) throws IOException {
  out.println(data);
  out.flush();
  String s=in.readLine();
  System.out.println(s);  // Only for debuging
}

    -Tom
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Selenium docs api java index 3 98
program arguments vs VM arguments 4 58
Html split(text) 2 50
Java pass by reference 3 74
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question