Solved

How to send in Java Applet like from Netscape

Posted on 1997-11-03
8
186 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
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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
topping2 challenge 13 80
How can I do a Massively massive community reviewing-and-grading site? 7 69
github account with ecipse 1 42
ForLoop Example 3 40
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

948 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now