当前位置:编程学习 > JSP >>

用javamail发邮件(含附件),用jBuilder3实现

//Title:        Your Product Name
//Version:
//Copyright:    Copyright (c) 1999
//Author:       Your Name
//Company:      Your Company
//Description:  Your description
package Mail;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
public class SendMail extends Frame {
  Label label1 = new Label();
  TextField textField1 = new TextField();
  Label label2 = new Label();
  TextField textField2 = new TextField();
  Label label3 = new Label();
  TextArea textArea1 = new TextArea();
  Label label4 = new Label();
  TextField textField3 = new TextField();
  Button button1 = new Button();
  Button button2 = new Button();
  public SendMail() {
   enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try  {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if(e.getID() == WindowEvent.WINDOW_CLOSING) {
      System.exit(0);
    }
  }
  public static void main(String[] args) {
    SendMail sendMail1 = new SendMail();
    sendMail1.setSize (400,400);
补充:Jsp教程,邮件
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,