🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.lang.java
Article #19464

[Internet]�����Java��������ô�ô����������

#19464
From: ��
Date: Mon, 05 Jan 2004 05:59
31 lines
1743 bytes
    ������Ҫдһ���ʼ��ͻ�����У���ﲻ�ô��?�У�����ô���ô����أ�

����dz��ļ򵥣�

    try
    {
      Properties  props = new Properties();
      props.put("mail.transport.protocol", "smtp");
      props.put("mail.smtp.host", smtpServer);
      props.put("mail.smtp.port", "25");

      Session  mailSession = Session.getInstance(props);
      Message  msg = new MimeMessage(mailSession);

      msg.setFrom(new InternetAddress(fromEmail));
      msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toEmail));
      msg.setSubject("Test Mail");
      msg.setText(body);

      Transport.send(msg);
      msg.writeTo(System.out);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }

˭֪��Ӧ����ô�ģ�лл��

--
�� ��Դ:��Ʈ��ˮ�Ƽ� freecity.cnzju.net��[FROM: 10.11.71.253]
Technical Details
Message-ID: <4A8gEC$9KJ@freecity.cnzju.net>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!news.bylinux.net!news.ccie.net.cn!Freecity

Show Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB
X-Google-Thread: f6cb0,585e1af00ebeb0b8,start
X-Google-Attributes: gidf6cb0,public
X-Google-ArrivalTime: 2004-01-04 21:52:30 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!news.bylinux.net!news.ccie.net.cn!Freecity
From: Constant.bbs@freecity.cnzju.net (��)
Newsgroups: cn.bbs.comp.lang.java
Subject: [Internet]�����Java��������ô�ô����������
Date: 05 Jan 2004 05:59:51 GMT
Organization: Ʈ��ˮ�Ƽ�
Message-ID: <4A8gEC$9KJ@freecity.cnzju.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="gb2312"
Content-Transfer-Encoding: 8bit
X-Filename: Java/M.1073282220.A
Lines: 31