non capisco il problema... a te basta che il pc dove gira l'applet sia collegato a internet e poi tutti i parametri di invio saranno settati in base alla tua mail...
se questa è la classe per inviare una mail
codice:
import java.util.*;
import java.net.*;
import java.io.*;
public class InvioMail
{
static BufferedReader in;
static PrintWriter out;
static String server=”.....”; //metti il tuo smtp
static String mittente=”....”; mittente
static String destinatario=”....”; tuo indirizzo mail
static String messaggio=”ciao”;//prelevi il mess dal form
public static void main(String[] args)
{
try
{
Socket s = new Socket(server, 25);
out = new PrintWriter(s.getOutputStream());
in = new BufferedReader(new InputStreamReader(s.getInputStream()));
String hostName = InetAddress.getLocalHost().getHostName();
receive();
send(”HELO ” + hostName);
receive();
send(”MAIL FROM: <” + mittente + “>”);
receive();
send(”RCPT TO: <” + destinatario + “>”);
receive();
send(”DATA”);
receive();
StringTokenizer tokenizer = new StringTokenizer(messaggio, “\n”);
while (tokenizer.hasMoreTokens())
send(tokenizer.nextToken());
send(”.”);
receive();
s.close();
}
catch (IOException exception)
{
System.out.println(”Error: ” + exception);
}
}
public static void send(String s) throws IOException
{
System.out.println(s);
System.out.println(”\n”);
out.print(s);
out.print(”\r\n”);
out.flush();
}
public static void receive() throws IOException
{
String line = in.readLine();
if (line != null)
{
System.out.println(line);
System.out.println(”\n”);
}
}
}