README for the demo programs in this directory
==============================================
These demo programs illustrate how to use the JavaMail API to
perform a number of common email functions. Note these these
programs are not intended to be examples of good user interfaces,
or good command line interfaces. No one is expected to actually
*use* these programs for anything real. Rather, their value is
in the source code. Don't look at their command line arguments
or user interface to figure out what JavaMail can do, look at
their source code. We strongly recommend that you read the
source code and understand what these programs are doing before
running them.
All of these programs are simple command line tools with a UNIX
style interface. On Windows you'll need to run them in an MS-DOS
window. We apologize in advance for the inconsistency in how these
programs accept options. There are generally two styles. The very
simple style (e.g., as used by copier.java) requires a fixed number
of arguments in a fixed order. Others (e.g., folderlist.java) take
UNIX-style options, many of which are optional, and which may appear
in any order. The following notes should help you figure it out,
but if in doubt, read the source code.
- copier.java
This program copies the specified messages from one folder to
another. Both folders must belong to the same store.
Usage:
java copier <urlname> <src> <dest> <start> <end>
Arguments (in order):
<urlname> : URL of the Store. The URL should include
the password as well (if needed).
Example: "imap://john:password@mailstore.com"
<src> : source folder
<dest> : destination folder
<start> : start message number
<end> : end message number
- folderlist.java
This program lists information about the folders in a Store.
Usage:
java folderlist -L <url> -T <protocol> -H <host> -U <user> -P <passwd>
[-R <root>] [-r] [-v] [-D] <pattern>
Options:
-L <url> : URL of the Store. The URL should include
the password as well (if needed).
Example: "imap://john:password@mailstore.com"
-T <protocol> : store protocol (Ex: "imap")
-H <host> : hostname of store.
-U <user> : username (if needed)
-P <passwd> : password (if needed)
-R <root> : root of the folder hierarchy. This is optional. If
not present, listing starts from the default folder.
-r : list recursively - folder and all subfolders.
-v : verbose - show more info about each folder.
-D : Turn on session debugging
<pattern> : folders that match this pattern are listed. Use "*"
as wildcard to match everything.
- monitor.java
Illustrates how to monitor a folder for interesting events,
like new mail arrival.
Usage:
java monitor <host> <user> <password> <mbox> <freq>
Arguments (in order):
<host> : hostname of store.
<user> : username (if needed)
<passwd> : password (if needed)
<mbox> : folder to monitor
<freq> : frequency of monitoring
- mover.java
Moves messages between folders. The folders must belong to the
same store.
Usage:
java mover -T <protocol> -H <host> -U <user> -P <passwd> [-v]
-s <src> -d <dest> [-x] <start> <end>
Options:
-T <protocol> : store protocol (Ex: "imap")
-H <host> : hostname of store.
-U <user> : username (if needed)
-P <passwd> : password (if needed)
-s <src> : source folder
-d <dest> : destination folder
-v : Optional verbose option
-x : Optional expunge option, to expunge the deleted
messages from src
Arguments (in order):
<start> : start message number
<end> : end message number
- msgmultisendsample.java
Demonstrates how to construct and send a multipart message.
Usage:
java msgmultisendsample <to> <from> <smtphost> true|false
Arguments (in order):
<to> : Recipient address
<from> : Sender address
<smtphost> : name of SMTP server
true|false : "true" to turn on session debugging, "false" otherwise
- msgsend.java
Send a simple text message. Optionally saves a copy
of the outgoing message in a folder (record-folder).
Most parameters to this program are optional. When
the program is run, it interactively asks for
the "To" and "Subject" fields if not already available.
Then the program expects the body of the message.
After you type in the body, hit Ctrl-D on Unix
systems or Ctrl-Z on Windows systems to send
the message.
Usage:
java msgsend -L <store-url> -T <protocol> -H <host> -U <user>
-P <passwd> -s <subject> -o <from> -c <cc> -b <bcc>
-f <record> -M <smtphost> [-d] <to>
Options:
-L <store-url> : URL of the store for the record-folder
-T <protocol> : If <store-url> is not present, this indicates
the store protocol for the record-folder.
-H <host> : If <store-url> is not present, this indicates
the hostname for the record-folder.
-U <user> : If <store-url> is not present, this indicates
the username for the record-folder.
-P <passwd> : If <store-url> is not present, this indicates
the password for the record-folder.
-f <record> : name of record-folder.
-M <smtphost> : Host name of SMTP server. Defaults to "localhost"
which often works on UNIX but rarely on Windows.
-s <subject> : Subject of message to be sent
-o <from> : From address of message to be sent
-c <cc> : Cc address of message to be sent
-b <bcc> : Bcc address of message to be sent
-d : Turn on session debugging.
-a <file> : Include file as an attachment with the message
Argument:
<to> : To address of message to be sent
- msgsendsample.java
Demonstrates how to construct and send a simple text message.
Usage:
java msgsendsample <to> <from> <smtphost> true|false
Arguments (in order):
<to> : Recipient address
<from> : Sender address
<smtphost> : name of SMTP server
true|false : "true" to turn on session debugging, "false" otherwise
- msgshow.java
Displays message(s) from a folder or from stdin.
Usage:
java msgshow -L <url> -T <protocol> -H <host> -p <port>
-U <user> -P <password> -f <mailbox>
[-D] [-s] [-S] [-a] [-v] [msgnum]
java msgshow -m [-D] [-s] [-S] [-v]
Options:
-L <url> : URL of the Store. The URL should include
the password as well (if needed).
Example: "imap://john:password@mailstore.com"
-T <protocol> : If <url> is not present, this indicates
the store protocol
-H <host> : If <url> is not present, this indicates
the hostname
-p <port> : If <url> is not present, this indicates
the port number (usually not needed)
-U <user> : If <url> is not present, this indicates
the username
-P <passwd> : If <url> is not present, this indicates
the password
-f <mailbox> : Folder to open
-m : Read message from standard input
-D : Turn on session debugging
-s : Show the structure of the message, but not the contents
-S : Save attachments to appropriately named files
-a : Show ALERTS and NOTIFICATIONS from the Store
-v : Verbose mode - show total messages and number of new messages
Argument:
<msgnum> : the message to be displayed. If this
parameter is not present, all messages in the
folder are displayed.
- namespace.java
Displays the namespaces supported by a store.
Usage:
java namespace -L <url> -T <protocol> -H <host> -p <port>
-U <user> -P <password> [-D]
Options:
-L <url> : URL of the Store. The URL should include
the password as well (if needed).
Example: "imap://john:password@mailstore.com"
-T <protocol> : If <url> is not present, this indicates
the store protocol
-H <host> : If <url> is not present, this indicates
the hostname
-p <port> : If <url> is not present, this indicates
the port number (usually not needed)
-U <user> : If <url> is not present, this indicates
the username
-P <passwd> : If <url> is not present, this indicates
the password
-D : Turn on session debugging
- populate.j
没有合适的资源?快使用搜索试试~ 我知道了~
javamail API
共403个文件
html:323个
java:42个
txt:14个
需积分: 0 4 下载量 120 浏览量
2008-05-13
09:54:15
上传
评论
收藏 2.33MB ZIP 举报
温馨提示
包括JavaMail API
资源详情
资源评论
资源推荐
收起资源包目录
javamail API (403个子文件)
build.bat 637B
stylesheet.css 1KB
inherit.gif 57B
MessagingException.html 216KB
MimeMessage.html 161KB
IMAPFolder.html 115KB
Folder.html 112KB
index-7.html 109KB
MimeBodyPart.html 96KB
index-19.html 71KB
Message.html 62KB
Message.html 59KB
POP3Folder.html 55KB
POP3Message.html 53KB
Session.html 52KB
Address.html 52KB
serialized-form.html 50KB
Folder.html 46KB
Part.html 46KB
SMTPMessage.html 44KB
index-13.html 43KB
InternetAddress.html 41KB
IMAPStore.html 39KB
MultipartReport.html 38KB
MimeUtility.html 38KB
SMTPTransport.html 38KB
Service.html 37KB
MimeMultipart.html 36KB
package-use.html 35KB
Store.html 33KB
MessageHeaders.html 31KB
index-1.html 31KB
MimePart.html 31KB
SharedFileInputStream.html 29KB
POP3Store.html 28KB
SearchTerm.html 27KB
InternetHeaders.html 27KB
index-3.html 27KB
index-18.html 26KB
Multipart.html 26KB
overview-tree.html 26KB
Transport.html 25KB
Session.html 25KB
constant-values.html 25KB
Flags.html 25KB
Flags.html 24KB
URLName.html 24KB
TransportEvent.html 23KB
PreencodedMimeBodyPart.html 23KB
index-9.html 23KB
index-6.html 23KB
Rights.html 22KB
ContentType.html 21KB
SendFailedException.html 21KB
Message.RecipientType.html 21KB
package-summary.html 21KB
NewsAddress.html 21KB
FolderEvent.html 21KB
package-summary.html 21KB
MailDateFormat.html 20KB
package-summary.html 20KB
URLName.html 20KB
index-16.html 20KB
index-5.html 20KB
InternetHeaders.html 19KB
MessageCountEvent.html 19KB
SMTPSendFailedException.html 19KB
SMTPAddressFailedException.html 19KB
DeliveryStatus.html 19KB
Part.html 18KB
index-20.html 18KB
index-14.html 18KB
ParameterList.html 18KB
index-8.html 18KB
AddressException.html 18KB
HeaderTokenizer.html 17KB
ContentDisposition.html 17KB
UIDFolder.html 17KB
SMTPAddressSucceededException.html 17KB
Rights.Right.html 17KB
RecipientStringTerm.html 17KB
MimeMessage.html 17KB
MimePartDataSource.html 17KB
index-4.html 17KB
MessagingException.html 17KB
package-summary.html 17KB
Store.html 17KB
RecipientTerm.html 16KB
MessageChangedEvent.html 16KB
SharedByteArrayInputStream.html 16KB
DateTerm.html 16KB
SMTPSSLTransport.html 16KB
IMAPSSLStore.html 16KB
IntegerComparisonTerm.html 16KB
ComparisonTerm.html 16KB
StoreEvent.html 16KB
StringTerm.html 16KB
ByteArrayDataSource.html 16KB
FetchProfile.html 16KB
allclasses-frame.html 16KB
共 403 条
- 1
- 2
- 3
- 4
- 5
changqiguo
- 粉丝: 0
- 资源: 2
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 通道处理过程的模拟通常涉及对通道处理机制的理解与实现.txt
- Flume进阶-自定义拦截器jar包
- Dubins曲线算法讲解和在运动规划中的使用.pdf
- 上市公司-股票性质数据-工具变量(民企、国企、央企)2003-2022年.dta
- 上市公司-股票性质数据-工具变量(民企、国企、央企)2003-2022年.xlsx
- Reeds+Shepp曲线算法讲解和实现.pdf
- 毕业设计基于SpringBoot+MyBatisPlus+MySQL+Vue的外卖配送信息系统源代码+数据库
- 词向量(Word Embeddings)是自然语言处理(NLP)领域的一种重要技术.txt
- Surfer,线性函数
- MyBatis 的动态 SQL 是其核心特性之一.txt
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0