How to set up to retrieve email from different users

Hi,

I have the following problem:

I have written a Java application for some video/postproduction work.

This application is using Java webstart, so different users are able to use the application via internet. Now I want the users to be able to send the content of a JTextField by e-mail automatically.

right now I have it working, but only if I set-up the java application first to the smtp server of the client. But because there are different clients with different smtp servers I can't use this method.

I'm looking to use only the default Java Api,

so that any user easily can use the application.

So what I want to accomplish:

user start application

user fill in TextField

user clicks e-mail button(which send mail to test@server.com)

I don't need to see the e-mail adress from the user,

but I want to see the mail from the different users all as the mail fromApplication@server.com.

right now I can set up the application for one user

with the following code:

BufferedReader buffRead;

PrintStream printStream;

try{

socket = new Socket("smtp.xs4all.nl", 25);

buffRead = new BufferedReader(

new InputStreamReader(socket.getInputStream()));

printStream = new PrintStream(socket.getOutputStream());printStream.println("HELO xs4all.nl");

printStream.println("mail from: spot@postmen.tv");

System.out.println(buffRead.readLine());

String Addressee= "peter.vanrij@student.hu.nl";

printStream.println("rcpt to: " + Addressee);

System.out.println(buffRead.readLine());

printStream.println("data");

String clientName = clientField.getText();

printStream.println("Subject:EDL from "+clientName+" is"+mailStatus+"\n\n");

System.out.println(buffRead.readLine());

String tempmail = edlArea.getText();

printStream.println(tempmail);

printStream.println(".");

System.out.println(buffRead.readLine());

printStream.flush();

socket.close();

sorry about the layout.

this works, but only if the user has mailserver xs4all

does someone know a method for getting this to work with every user?

[2230 byte] By [Pleisurea] at [2007-11-27 8:18:21]
# 1

There's no well-defined way to figure out what mail server any random

user is using. If you really need each user to use their own mail server,

you're going to have to ask them. With some (completely non-portable)

heuristics, you might be able to guess right in many cases.

An alternative is to have all users use a mail server that you control.

bshannona at 2007-7-12 20:03:52 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Thanx for reply!

The users are not all technically oriented,

so I want to make it as easy for them as I can.

Can you maybe explain how to use a mail server that I can control?

what do you mean by that.

At the office we already using a mailserver by a hosting provider.

Pleisurea at 2007-7-12 20:03:52 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3

Well, certainly one way to do it is to contract with a hosting provider to

provide mail service for all your users. The hosting provider will run and

maintain the mail server and will tell you what you need to know to use

the mail server, what accounts to use, how to login, etc. Then you code

your application to use that mail server.

Another alternative is to buy a machine, connect it to the internet, acquire

mail server software, install it, configure it, and maintain it yourself. Then

code your application to use that mail server.

bshannona at 2007-7-12 20:03:52 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...