用java编写
邮件
收发
程序
我想写一个 邮件 收发 程序,不知道应该从那里入手,是不是要有个服务器啊,请各位前辈给点建议.我初学者,没有多少分,谢谢了.
------解决方案--------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.net.*;
import java.io.*;
import javax.swing.*;
/**
This program shows how to use sockets to send plain text
mail messages.
*/
public class MailTest
{
public static void main(String[] args)
{
JFrame frame = new MailTestFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
/**
The frame for the mail GUI.
*/
class MailTestFrame extends JFrame
{
public MailTestFrame()
{
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
setTitle( "MailTest ");
setLayout(new GridBagLayout());
// we use the GBC convenience class of Core Java Volume 1 Chapter 9
add(new JLabel( "From: "), new GBC(0, 0).setFill(GBC.HORIZONTAL));
from = new JTextField(20);
add(from, new GBC(1, 0).setFill(GBC.HORIZONTAL)…………………………………………………………………………
我想写一个 邮件 收发 程序,不知道应该从那里入手,是不是要有个服务器啊,请各位前辈给点建议.我初学者,没有多少分,谢谢了.
------解决方案--------------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.net.*;
import java.io.*;
import javax.swing.*;
/**
This program shows how to use sockets to send plain text
mail messages.
*/
public class MailTest
{
public static void main(String[] args)
{
JFrame frame = new MailTestFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
/**
The frame for the mail GUI.
*/
class MailTestFrame extends JFrame
{
public MailTestFrame()
{
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
setTitle( "MailTest ");
setLayout(new GridBagLayout());
// we use the GBC convenience class of Core Java Volume 1 Chapter 9
add(new JLabel( "From: "), new GBC(0, 0).setFill(GBC.HORIZONTAL));
from = new JTextField(20);
add(from, new GBC(1, 0).setFill(GBC.HORIZONTAL)…………………………………………………………………………