Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to send in Java Applet like from Netscape

Posted on 1997-11-03
8
Medium Priority
?
197 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 400 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

715 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