Topic: Simple Mail Sender (bean) |
Print this page |
1.Simple Mail Sender (bean) | Copy to clipboard |
Posted by: diystar Posted on: 2003-06-19 17:50 import java.util.*; SimpleMail.java (6.56k) |
2.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: diystar Posted on: 2003-06-19 18:02 看到好像很多人为此困扰,我就斗胆献丑,喜欢的支持一下 |
3.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: why Posted on: 2003-06-19 19:39 既然是diystar原创的,就打分吧。 小的修改了大侠的留言,选了 Disable Smileys indentation 有点不太理想喔,希望大侠有空时修葺一下啦! 如果加一个用例,就更理想了。(虽然小的不需要) |
4.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: diystar Posted on: 2003-06-20 09:12 多谢版主,我已调整了程序的格式 |
5.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: floater Posted on: 2003-06-20 23:39 Could you write a simple main() to show how to use it please? |
6.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: FinalFantasy Posted on: 2003-06-22 00:09 如果能加入 charset 的变换,IMAP的支持(主要就是参数的不同。) 还有pop/IMAP的的接受,就更好了。。。^_^,收下了,谢谢。。 |
7.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: diystar Posted on: 2003-06-23 09:04 已增加了main用例,关于pop/IMAP的支持嘛…… |
8.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: FinalFantasy Posted on: 2003-06-23 16:22 哦,我也许表达的不清楚, IMAP是一个协议,收发都用它的,所以,实现也很容易。 |
9.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: asdlcj Posted on: 2003-06-24 23:31 我在 sohu 上有油箱! 邮件发送服务器 可不可以这样设置 啊? www.sohu.com 谢了 |
10.Re:Simple Mail Sender (bean) [Re: asdlcj] | Copy to clipboard |
Posted by: 牛老板 Posted on: 2003-06-24 23:56 呵呵,我用了几种转换方式,终于让他们该换行就换行,呵呵,累死了,收藏了这个贴子. |
11.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: asdlcj Posted on: 2003-06-25 00:08 大哥!你说啊! 怎么设置 啊 |
12.Re:Simple Mail Sender (bean) [Re: asdlcj] | Copy to clipboard |
Posted by: why Posted on: 2003-06-25 02:51 asdlcj wrote: if your SMTP server doesn't require authentication, then Transport.send(mimeMsg);//发送邮件 will do the job; if it does require authentication, then you need something like: message.saveChanges(); // implicit with send() Transport transport = session.getTransport("smtp"); transport.connect(host, username, password); transport.sendMessage(message, message.getAllRecipients()); transport.close(); you may have to setup something else, like an Authenticator... I didn't have the resource to try -- my ISP doesn't require authentication. Source: http://developer.java.sun.com/developer/onlineTraining/JavaMail/contents.html |
13.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: floater Posted on: 2003-06-25 03:01 simple, straightforward, clean, quite an example for us. |
14.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: szmustang Posted on: 2003-06-25 09:19 Good! 简洁明了! |
15.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: diystar Posted on: 2003-06-25 11:40 牛老板 wrote: 好像论坛的代码拷贝回车符会无效,看来我还是传一份附件吧 |
16.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: asdlcj Posted on: 2003-06-26 21:16 public static void main(String[] args) { SimpleMail mail = new SimpleMail(); mail.setSender("li_chunjin@21cn.com"); mail.setSmtpHost("pop.sohu.com"); mail.setUser("li_chunjin"); mail.setPassword("******"); mail.setReceiver("li-chunjin@21cn.com; lichunjin@21cn.com"); mail.setContent("test mail sender"); mail.setAffixPath("C:/boot.ini; C:/config.sys"); try { mail.smtp(); } catch (MessagingException ex) { ex.printStackTrace(); } } 我main中这样改! 编译成功产生2个class 可是我java SimpleMail 产生错误:找不到main的class 怎么回事啊?谢谢! |
17.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: abc123 Posted on: 2003-06-27 00:20 乱码问题没有解决? |
18.Re:Simple Mail Sender (bean) [Re: diystar] | Copy to clipboard |
Posted by: asdlcj Posted on: 2003-06-27 18:06 这是用字母 的!不会乱吗的 不是这个问题啊 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |