当前位置:首页 » 软件开发
开发技术指南» 文章正文
    引言: 本文根据Ian F. Darwin的《Java Cookbook》整理而成,原书用整章的文字介绍如何发邮件,可能头绪会比较乱,本文则将其浓缩成一篇文章,力求使完全不懂JavaMail的人,都可以根据文中指示稍作修改,拿来就可以用。
 

 

 ·jsp学习笔记--jsp标签库    »显示摘要«
    摘要: 原文地址:http://www.7880.com/info/article-461b6340.html1.jsp标签库(也称自定义库)可看成是一套产生基于xml脚本的方法,它经由javabeans来支持。在概念上说,标签库是非常简单和可以重用的代码构造。它可以大大简化你在页面中输入各种录入框的代码(诸如此类的代码:<input type="text" name=&quo......
 ·第一次回答java初学者的问题    »显示摘要«
    摘要: 今天在实验室悟道,邻座曰有学友请教java之问题。开始甚是紧张,不知此君法力如何,恐不能解人之惑。告知于qq号码,探讨之内容如下:2005-03-06 22:21:17 349863475你好,我刚开始学java,知道你是高手,像请教你几个问题, 2005-03-06 22:14:42 xyq我以前做过一点点,几年没用了,能解决就解决,不行的话,我帮你查查 2005-03-06 22:23:50......


用JavaMail发送带附件的邮件

本文根据ian f. darwin的«java cookbook»整理而成,原书用整章的文字介绍如何发邮件,可能头绪会比较乱,本文则将其浓缩成一篇文章,力求使完全不懂javamail的人,都可以根据文中指示稍作修改,拿来就可以用.如果对其中原理还有不清楚,你可以参考原书.

1.mailconstants.java,properties文件的助记符:///////////////////////////////////////////////////////////////////////package untitled2; 【程序编程相关:java:自己写的实现翻页功能的类

一.首先要用到三个java文件: 【推荐阅读:acegi中的cache配置

  public static final string send_proto = "mail.send.protocol";  public static final string send_user = "mail.send.user";  public static final string send_pass = "mail.send.password";  public static final string send_root = "mail.send.root";  public static final string send_host = "mail.send.host";  public static final string send_debug = "mail.send.debug"; 【扩展信息:jsp+mysql制作简单的留言板(2)

/** simply a list of names for the mail system to use. * if you "implement" this interface, you dont have to prefix * all the names with mailprops in your code. */public interface mailconstants {  public static final string props_file_name = "mailclient.properties";

  public static final string recv_proto = "mail.receive.protocol";  public static final string recv_port = "mail.receive.port";  public static final string recv_user = "mail.receive.user";  public static final string recv_pass = "mail.receive.password";  public static final string recv_root = "mail.receive.root";  public static final string recv_host = "mail.receive.host";  public static final string recv_debug = "mail.receive.debug";}///////////////////////////////////////////////////////////////////////

2.fileproperties.java,从文件中读取properties:///////////////////////////////////////////////////////////////////////package untitled2;

import java.io.*;import java.util.*;

/** * the <code>fileproperties</code> class extends <code>properties</code>, * "a persistent set of properties [that] can be saved to a stream * or loaded from a stream". this subclass attends to all the mundane * details of opening the stream(s) for actually saving and loading * the properties. * * <p>this subclass preserves the useful feature that * a property list can contain another property list as its * "defaults"; this second property list is searched if * the property key is not found in the original property list. * * @author ian f. darwin, ian@darwinsys.com * @version $id: fileproperties.java,v 1.5 2001/04/28 13:22:37 ian exp $ */public class fileproperties    extends properties {  protected string filename = null;


...   下一页
 ·javamail的几个实用知识点.    »显示摘要«
    摘要: 1.把邮件保存为一个文件,这个文件可以直接用outlook,foxmail等邮件客户端工具打开。 private void savemail(mimemessage msg, string path) { try { file f = new file(path); f.getparentfile().mkdirs(); fileoutputstream fo = new fileoutputs......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE