javamail - 协议SMTP\IMAP\POP3设置
资料来自:https://www.tutorialspoint.com/javamail_api/index.htm
【SMTP - Simple Mail Transfer Protocol】
Name | Type | Description |
---|---|---|
mail.smtp.user | String | Default user name for SMTP. |
mail.smtp.host | String | The SMTP server to connect to. |
mail.smtp.port | int | The SMTP server port to connect to, if the connect() method doesn't explicitly specify one. Defaults to 25. |
mail.smtp.connectiontimeout | int | Socket connection timeout value in milliseconds. Default is infinite timeout. |
mail.smtp.timeout | int | Socket I/O timeout value in milliseconds. Default is infinite timeout. |
mail.smtp.from | String | Email address to use for SMTP MAIL command. This sets the envelope return address. Defaults to msg.getFrom() or InternetAddress.getLocalAddress(). |
mail.smtp.localhost | String | Local host name used in the SMTP HELO or EHLO command. Defaults to InetAddress.getLocalHost().getHostName(). Should not normally need to be set if your JDK and your name service are configured properly. |
mail.smtp.localaddress | String | Local address (host name) to bind to when creating the SMTP socket. Defaults to the address picked by the Socket class. Should not normally need to be set. |
mail.smtp.localport | int | Local port number to bind to when creating the SMTP socket. Defaults to the port number picked by the Socket class. |
mail.smtp.ehlo | boolean | If false, do not attempt to sign on with the EHLO command. Defaults to true. |
mail.smtp.auth | boolean | If true, attempt to authenticate the user using the AUTH command. Defaults to false. |
mail.smtp.auth.mechanisms | String | If set, lists the authentication mechanisms to consider. Only mechanisms supported by the server and supported by the current implementation will be used. The default is "LOGIN PLAIN DIGEST-MD5 NTLM", which includes all the authentication mechanisms supported by the current implementation. |
mail.smtp.auth.login.disable | boolean | If true, prevents use of the AUTH LOGIN command. Default is false. |
mail.smtp.auth.plain.disable | boolean | If true, prevents use of the AUTH PLAIN command. Default is false. |
mail.smtp.auth.digest-md5.disable | boolean | If true, prevents use of the AUTH DIGEST-MD5 command. Default is false. |
mail.smtp.auth.ntlm.disable | boolean | If true, prevents use of the AUTH NTLM command. Default is false. |
mail.smtp.auth.ntlm.domain | String | The NTLM authentication domain. |
mail.smtp.auth.ntlm.flags | int | NTLM protocol-specific flags. |
mail.smtp.submitter | String | The submitter to use in the AUTH tag in the MAIL FROM command. Typically used by a mail relay to pass along information about the original submitter of the message. |
mail.smtp.dsn.notify | String | The NOTIFY option to the RCPT command. Either NEVER, or some combination of SUCCESS, FAILURE, and DELAY (separated by commas). |
mail.smtp.dsn.ret | String | The RET option to the MAIL command. Either FULL or HDRS. |
mail.smtp.sendpartial | boolean | If set to true, and a message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. If set to false (the default), the message is not sent to any of the recipients if there is an invalid recipient address. |
mail.smtp.sasl.enable | boolean | If set to true, attempt to use the javax.security.sasl package to choose an authentication mechanism for login. Defaults to false. |
mail.smtp.sasl.mechanisms | String | A space or comma separated list of SASL mechanism names to try to use. |
mail.smtp.sasl.authorizationid | String | The authorization ID to use in the SASL authentication. If not set, the authentication ID (user name) is used. |
mail.smtp.sasl.realm | String | The realm to use with DIGEST-MD5 authentication. |
mail.smtp.quitwait | boolean | If set to false, the QUIT command is sent and the connection is immediately closed. If set to true (the default), causes the transport to wait for the response to the QUIT command. |
mail.smtp.reportsuccess | boolean | If set to true, causes the transport to include an SMTPAddressSucceededException for each address that is successful. |
mail.smtp.socketFactory | Socket Factory | If set to a class that implements the javax.net.SocketFactory interface, this class will be used to create SMTP sockets. |
mail.smtp.socketFactory.class | String | If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create SMTP sockets. |
mail.smtp.socketFactory.fallback | boolean | If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true. |
mail.smtp.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.smtp.ssl.enable | boolean | If set to true, use SSL to connect and use the SSL port by default. Defaults to false for the "smtp" protocol and true for the "smtps" protocol. |
mail.smtp.ssl.checkserveridentity | boolean | If set to true, checks the server identity as specified by RFC 2595. Defaults to false. |
mail.smtp.ssl.trust | String | If set, and a socket factory hasn't been specified, enables use of a MailSSLSocketFactory. If set to "*", all hosts are trusted. If set to a whitespace separated list of hosts, those hosts are trusted. Otherwise, trust depends on the certificate the server presents. |
mail.smtp.ssl.socketFactory | SSL Socket Factory | If set to a class that extends the javax.net.ssl.SSLSocketFactory class, this class will be used to create SMTP SSL sockets. |
mail.smtp.ssl.socketFactory.class | String | If set, specifies the name of a class that extends the javax.net.ssl.SSLSocketFactory class. This class will be used to create SMTP SSL sockets. |
mail.smtp.ssl.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.smtp.ssl.protocols | string | Specifies the SSL protocols that will be enabled for SSL connections. The property value is a whitespace separated list of tokens acceptable to the javax.net.ssl.SSLSocket.setEnabledProtocols method. |
mail.smtp.starttls.enable | boolean | If true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Defaults to false. |
mail.smtp.starttls.required | boolean | If true, requires the use of the STARTTLS command. If the server doesn't support the STARTTLS command, or the command fails, the connect method will fail. Defaults to false. |
mail.smtp.socks.host | string | Specifies the host name of a SOCKS5 proxy server that will be used for connections to the mail server. |
mail.smtp.socks.port | string | Specifies the port number for the SOCKS5 proxy server. This should only need to be used if the proxy server is not using the standard port number of 1080. |
mail.smtp.mailextension | String | Extension string to append to the MAIL command. |
mail.smtp.userset | boolean | If set to true, use the RSET command instead of the NOOP command in the isConnected method. In some cases sendmail will respond slowly after many NOOP commands; use of RSET avoids this sendmail issue. Defaults to false. |
【IMAP - Internet Message Access Protocol】
Name | Type | Description |
---|---|---|
mail.imap.user | String | Default user name for IMAP. |
mail.imap.host | String | The IMAP server to connect to. |
mail.imap.port | int | The IMAP server port to connect to, if the connect() method doesn't explicitly specify one. Defaults to 143. |
mail.imap.partialfetch | boolean | Controls whether the IMAP partial-fetch capability should be used. Defaults to true. |
mail.imap.fetchsize | int | Partial fetch size in bytes. Defaults to 16K. |
mail.imap.ignorebodystructuresize | boolean | The IMAP BODYSTRUCTURE response includes the exact size of each body part. Normally, this size is used to determine how much data to fetch for each body part. Defaults to false. |
mail.imap.connectiontimeout | int | Socket connection timeout value in milliseconds. Default is infinite timeout. |
mail.imap.timeout | int | Socket I/O timeout value in milliseconds. Default is infinite timeout. |
mail.imap.statuscachetimeout | int | Timeout value in milliseconds for cache of STATUS command response. Default is 1000 (1 second). Zero disables cache. |
mail.imap.appendbuffersize | int | Maximum size of a message to buffer in memory when appending to an IMAP folder. |
mail.imap.connectionpoolsize | int | Maximum number of available connections in the connection pool. Default is 1. |
mail.imap.connectionpooltimeout | int | Timeout value in milliseconds for connection pool connections. Default is 45000 (45 seconds). |
mail.imap.separatestoreconnection | boolean | Flag to indicate whether to use a dedicated store connection for store commands. Default is false. |
mail.imap.auth.login.disable | boolean | If true, prevents use of the non-standard AUTHENTICATE LOGIN command, instead using the plain LOGIN command. Default is false. |
mail.imap.auth.plain.disable | boolean | If true, prevents use of the AUTHENTICATE PLAIN command. Default is false. |
mail.imap.auth.ntlm.disable | boolean | If true, prevents use of the AUTHENTICATE NTLM command. Default is false. |
mail.imap.proxyauth.user | String | If the server supports the PROXYAUTH extension, this property specifies the name of the user to act as. Authenticate to the server using the administrator's credentials. After authentication, the IMAP provider will issue the PROXYAUTH command with the user name specified in this property. |
mail.imap.localaddress | String | Local address (host name) to bind to when creating the IMAP socket. Defaults to the address picked by the Socket class. |
mail.imap.localport | int | Local port number to bind to when creating the IMAP socket. Defaults to the port number picked by the Socket class. |
mail.imap.sasl.enable | boolean | If set to true, attempt to use the javax.security.sasl package to choose an authentication mechanism for login. Defaults to false. |
mail.imap.sasl.mechanisms | String | A space or comma separated list of SASL mechanism names to try to use. |
mail.imap.sasl.authorizationid | String | The authorization ID to use in the SASL authentication. If not set, the authentication ID (user name) is used. |
mail.imap.sasl.realm | String | The realm to use with SASL authentication mechanisms that require a realm, such as DIGEST-MD5. |
mail.imap.auth.ntlm.domain | String | The NTLM authentication domain. |
mail.imap.auth.ntlm.flags | int | NTLM protocol-specific flags. |
mail.imap.socketFactory | Socket Factory | If set to a class that implements the javax.net.SocketFactory interface, this class will be used to create IMAP sockets. |
mail.imap.socketFactory.class | String | If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create IMAP sockets. |
mail.imap.socketFactory.fallback | boolean | If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true. |
mail.imap.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. Default port is used when not set. |
mail.imap.ssl.enable | boolean | If set to true, use SSL to connect and use the SSL port by default. Defaults to false for the "imap" protocol and true for the "imaps" protocol. |
mail.imap.ssl.checkserveridentity | boolean | If set to true, check the server identity as specified by RFC 2595. Defaults to false. |
mail.imap.ssl.trust | String | If set, and a socket factory hasn't been specified, enables use of a MailSSLSocketFactory. If set to "*", all hosts are trusted. If set to a whitespace separated list of hosts, those hosts are trusted. Otherwise, trust depends on the certificate the server presents. |
mail.imap.ssl.socketFactory | SSL Socket Factory | If set to a class that extends the javax.net.ssl.SSLSocketFactory class, this class will be used to create IMAP SSL sockets. |
mail.imap.ssl.socketFactory.class | String | If set, specifies the name of a class that extends the javax.net.ssl.SSLSocketFactory class. This class will be used to create IMAP SSL sockets. |
mail.imap.ssl.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.imap.ssl.protocols | string | Specifies the SSL protocols that will be enabled for SSL connections. The property value is a whitespace separated list of tokens acceptable to the javax.net.ssl.SSLSocket.setEnabledProtocols method. |
mail.imap.starttls.enable | boolean | If true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Default is false. |
mail.imap.starttls.required | boolean | If true, requires the use of the STARTTLS command. If the server doesn't support the STARTTLS command, or the command fails, the connect method will fail. Defaults to false. |
mail.imap.socks.host | string | Specifies the host name of a SOCKS5 proxy server that will be used for connections to the mail server. |
mail.imap.socks.port | string | Specifies the port number for the SOCKS5 proxy server. This should only need to be used if the proxy server is not using the standard port number of 1080. |
mail.imap.minidletime | int | This property sets the delay in milliseconds. If not set, the default is 10 milliseconds. |
mail.imap.enableimapevents | boolean | Enable special IMAP-specific events to be delivered to the Store's ConnectionListener. If true, unsolicited responses received during the Store's idle method will be sent as ConnectionEvents with a type of IMAPStore.RESPONSE. The event's message will be the raw IMAP response string. By default, these events are not sent. |
mail.imap.folder.class | String | Class name of a subclass of com.sun.mail.imap.IMAPFolder. The subclass can be used to provide support for additional IMAP commands. The subclass must have public constructors of the form public MyIMAPFolder(String fullName, char separator, IMAPStore store, Boolean isNamespace) and public MyIMAPFolder(ListInfo li, IMAPStore store) |
【POP3 - Post Office Protocol】
Name | Type | Description |
---|---|---|
mail.pop3.user | String | Default user name for POP3. |
mail.pop3.host | String | The POP3 server to connect to. |
mail.pop3.port | int | The POP3 server port to connect to, if the connect() method doesn't explicitly specify one. Defaults to 110. |
mail.pop3.connectiontimeout | int | Socket connection timeout value in milliseconds. Default is infinite timeout. |
mail.pop3.timeout | int | Socket I/O timeout value in milliseconds. Default is infinite timeout. |
mail.pop3.rsetbeforequit | boolean | Send a POP3 RSET command when closing the folder, before sending the QUIT command. Default is false. |
mail.pop3.message.class | String | Class name of a subclass of com.sun.mail.pop3.POP3Message. The subclass can be used to handle (for example) non-standard Content-Type headers. The subclass must have a public constructor of the form MyPOP3Message(Folder f, int msgno) throws MessagingException. |
mail.pop3.localaddress | String | Local address (host name) to bind to when creating the POP3 socket. Defaults to the address picked by the Socket class. |
mail.pop3.localport | int | Local port number to bind to when creating the POP3 socket. Defaults to the port number picked by the Socket class. |
mail.pop3.apop.enable | boolean | If set to true, use APOP instead of USER/PASS to login to the POP3 server, if the POP3 server supports APOP. APOP sends a digest of the password rather than the clear text password. Defaults to false. |
mail.pop3.socketFactory | Socket Factory | If set to a class that implements the javax.net.SocketFactory interface, this class will be used to create POP3 sockets. |
mail.pop3.socketFactory.class | String | If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create POP3 sockets. |
mail.pop3.socketFactory.fallback | boolean | If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true. |
mail.pop3.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.pop3.ssl.enable | boolean | If set to true, use SSL to connect and use the SSL port by default. Defaults to false for the "pop3" protocol and true for the "pop3s" protocol. |
mail.pop3.ssl.checkserveridentity | boolean | If set to true, check the server identity as specified by RFC 2595. Defaults to false. |
mail.pop3.ssl.trust | String | If set, and a socket factory hasn't been specified, enables use of a MailSSLSocketFactory. If set to "*", all hosts are trusted. If set to a whitespace separated list of hosts, those hosts are trusted. Otherwise, trust depends on the certificate the server presents. |
mail.pop3.ssl.socketFactory | SSL Socket Factory | If set to a class that extends the javax.net.ssl.SSLSocketFactory class, this class will be used to create POP3 SSL sockets. |
mail.pop3.ssl.socketFactory.class | String | If set, specifies the name of a class that extends the javax.net.ssl.SSLSocketFactory class. This class will be used to create POP3 SSL sockets. |
mail.pop3.ssl.socketFactory.port | int | Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used. |
mail.pop3.ssl.protocols | string | Specifies the SSL protocols that will be enabled for SSL connections. The property value is a whitespace separated list of tokens acceptable to the javax.net.ssl.SSLSocket.setEnabledProtocols method. |
mail.pop3.starttls.enable | boolean | If true, enables the use of the STLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Defaults to false. |
mail.pop3.starttls.required | boolean | If true, requires the use of the STLS command. If the server doesn't support the STLS command, or the command fails, the connect method will fail. Defaults to false. |
mail.pop3.socks.host | string | Specifies the host name of a SOCKS5 proxy server that will be used for connections to the mail server. |
mail.pop3.socks.port | string | Specifies the port number for the SOCKS5 proxy server. |
mail.pop3.disabletop | boolean | If set to true, the POP3 TOP command will not be used to fetch message headers. Defaults to false. |
mail.pop3.forgettopheaders | boolean | If set to true, the headers that might have been retrieved using the POP3 TOP command will be forgotten and replaced by headers retrieved as part of the POP3 RETR command. Defaults to false. |
mail.pop3.filecache.enable | boolean | If set to true, the POP3 provider will cache message data in a temporary file rather than in memory. Messages are only added to the cache when accessing the message content. Message headers are always cached in memory (on demand). The file cache is removed when the folder is closed or the JVM terminates. Defaults to false. |
mail.pop3.filecache.dir | String | If the file cache is enabled, this property can be used to override the default directory used by the JDK for temporary files. |
mail.pop3.cachewriteto | boolean | Controls the behavior of the writeTo method on a POP3 message object. If set to true, and the message content hasn't yet been cached, and ignoreList is null, the message is cached before being written. Otherwise, the message is streamed directly to the output stream without being cached. Defaults to false. |
mail.pop3.keepmessagecontent | boolean | If this property is set to true, a hard reference to the cached content will be kept, preventing the memory from being reused until the folder is closed or the cached content is explicitly invalidated (using the invalidate method). Defaults to false. |
javamail - 协议SMTP\IMAP\POP3设置的更多相关文章
- 常用邮箱的 IMAP/POP3/SMTP 设置
通过网上查找的资料和自己的总结完成了下面的文章,看完之后相信大家对这三种协议会有更深入的理解.如有错误的地方望指正. POP3 POP3是Post Office Protocol 3的简称,即邮局协议 ...
- 理解邮件传输协议(SMTP、POP3、IMAP、MIME)
http://blog.csdn.net/xyang81/article/details/7672745 电子邮件需要在邮件客户端和邮件服务器之间,以及两个邮件服务器之间进行传递,就必须遵循一定的规则 ...
- 【转】常用邮箱的 IMAP/POP3/SMTP 设置
POP3 POP3是Post Office Protocol 3的简称,即邮局协议的第3个版本,它规定怎样将个人计算机连接到Internet的邮件服务器和下载电子邮件的电子协议.它是因特网电子邮件的第 ...
- 电子邮件的三个协议: SMTP、IMAP、POP3
个人总结: 读完这篇文章需要10分钟 讲解了跟电子邮件有关的三个协议: SMTP(simple message transfer protocol 简单信息传输协议 IMAP (internet me ...
- SMTP、POP3和IMAP邮件协议
目录 SMTP POP IMAP 总结 DNS记录中的MX记录 今天入职第一天,公司让配置个人的内网.外网邮箱,这可把我给搞晕了,本来以前就对邮箱这块不是很了解,平时也不怎么用邮箱,顶多有个QQ邮箱而 ...
- POP3&SMTP&IMAP
[POP3&SMTP&IMAP] IMAP是什么? IMAP,即Internet Message Access Protocol(互联网邮件访问协议),您可以通过这种协议从邮件服务器上 ...
- 邮件实现详解(二)------手工体验smtp和pop3协议
上篇博客我们简单介绍了电子邮件的发送和接收过程,对参与其中的邮件服务器,邮件客户端软件,邮件传输协议也有简单的介绍.我们知道电子邮件需要在邮件客户端和邮件服务器之间,以及两个邮件服务器之间进行传递必须 ...
- 电子邮件协议:SMTP、POP3、IMAP4
常见的电子邮件协议:SMTP.POP3.IMAP4 邮件发送协议:SMTP协议 邮件读取协议:POP3.IMAP4协议 SMTP协议(simple mail transfer protocol ...
- 你真的了解电子邮件系统的组成和结构吗?(SMTP、POP3、IMAP、MIME……)
文章转自:https://blog.csdn.net/weixin_43914604/article/details/105896201 学习课程:<2019王道考研计算机网络> 学习目的 ...
随机推荐
- react antD 日期选择
<DatePicker disabledDate={disabledDate} onChange={this.onChange} /> //创建时间禁用大于当前时间 <moment( ...
- ionic3开发环境搭建与配置(win10系统)
1.安装nodeJS(不会的自行百度) 2.安装ionic和cordova,执行以下命令: npm install -g ionic cordova 3.安装Java JDK: 下载地址:http:/ ...
- MySQL-date和datetime
MySQL中 date表示只有日期: insert into stu values(id = null, birthday = '2000-01-11'); datetime则还包含了时间: inse ...
- TestNG多线程测试-注解方式实现
用@Test(invocationCount = x,threadPoolSize = y)声明,invocationCount表示执行次数,threadPoolSize表示线程池大小. packag ...
- Servlet监听器的使用
Servlet监听器的使用 制作人:全心全意 在Servlet技术中已经定义了一些事件,并且可以针对这些事件来编写相关的事件监听器,从而对事件做出相应的处理.例如,想要在Web应用程序启动和关闭时来执 ...
- Shell中的循环语句实例
1.for循环语句实例1.1 最基本的for循环 #!/bin/bash for x in one two three four do echo number $x done 注:" ...
- vue.js通讯----父亲拿儿子的数据
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- NYOJ5 Binary String Matching
Binary String Matching 时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 Given two strings A and B, whose alp ...
- ECMAScript 6 入门学习笔记(一)——let和const
一.let ①声明变量 let a = 1: ②只在所在代码块内有效,不影响块以外 ③不存在变量提升(不能先用后声明) ④暂时性死区 let声明的变量“绑定”这个区域,不受外部影响. let声明之前, ...
- 一份关于jvm内存调优及原理的学习笔记(转)
JVM 一.虚拟机的基本结构 1.jvm整体架构 类加载子系统:负责从文件系统或者网络中加载class信息,存入方法区中. 方法区(Perm):存放加载后的class信息,包括静态方法,jdk1.6以 ...