资料来自: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.

转载于:https://www.cnblogs.com/15ho/p/5907174.html

javamail - 协议SMTP\IMAP\POP3设置相关推荐

  1. 邮件协议SMTP、POP3和IMAP

    邮件协议SMTP.POP3和IMAP SMTP (发送) POP(离线保存) IMAP(多端操作同一用户) 各种协议的host以及port 发送邮件 同一域下 不同域下 接收邮件 使用的是POP3协议 ...

  2. 《计算机网络》——文件传输协议FTP、简单邮件传送协议SMTP、邮局协议POP3、网际报文存取协议IMAP、万维网和HTTP协议、超文本传输协议HTTP

    文章目录 文件传输协议FTP FTP服务器和用户端 FTP工作原理 简单邮件传送协议SMTP 邮局协议POP3 网际报文存取协议IMAP 万维网和HTTP协议 超文本传输协议HTTP HTTP协议的特 ...

  3. JavaMail学习笔记(一)、理解邮件传输协议(SMTP、POP3、IMAP、MIME)

    电子邮件需要在邮件客户端和邮件服务器之间,以及两个邮件服务器之间进行传递,就必须遵循一定的规则,这些规则就是邮件传输协议.SMTP协议定了邮件客户端与SMTP服务之间,以及两台SMTP服务器之间发送邮 ...

  4. Javamail发信和收信机制(smtp、pop3、imap)

    javamail发信和收信机制(smtp.pop3.imap) import java.util.Date; import java.util.Properties;import javax.mail ...

  5. E-mail概述 | 邮件发送协议SMTP与邮件读取协议POP3、IMAP

    文章目录 电子邮件系统的组成 用户代理UA(User Agent) 邮件服务器 邮件发送协议 邮件读取协议 POP3 IMAP POP3与IMAP的对比 基于万维网的电子邮件 补充与思考 摘抄于文献 ...

  6. 邮件协议SMTP/POP3/IMAP——应用层

    一.SMTP协议 1.SMTP协议简介 SMTP称为简单邮件传输协议(Simple Mail Transfer Protocal),目标是向用户提供高效.可靠的邮件传输.它的一个重要特点是它能够在传送 ...

  7. 电子邮件协议---SMTP,POP3,IMAP,MIME

    在应用层的另外一个典型的应用例子就是电子邮件 电子邮件的传送和通过浏览器访问其他主机的文件有不同之处,电子邮件的形式更多像我们日常生活中的邮箱. 电子邮件的概述: 在用户写好电子邮件之后,电子邮件首先 ...

  8. 电子邮件协议(SMTP,MIME,POP3,IMAP)

    SMTP 关键词: 电子邮件协议:SMTP简单邮件传输协议,负责将邮件上传到服务器,采用TCP的25端口,C/S工作.仅传送ASCII码文本 详细介绍: SMTP是一种提供可靠且有效的电子邮件传输的协 ...

  9. SMTP、POP3和IMAP邮件协议

    目录 SMTP POP IMAP 总结 DNS记录中的MX记录 今天入职第一天,公司让配置个人的内网.外网邮箱,这可把我给搞晕了,本来以前就对邮箱这块不是很了解,平时也不怎么用邮箱,顶多有个QQ邮箱而 ...

最新文章

  1. 从 no-code 到 low-code 再到 pro-code
  2. gtk移植到嵌入式_物联网时代的盛行,应届毕业生是学嵌入式好呢,还是安卓或ios呢?...
  3. android surfaceflinger研究----SurfaceFlinger loop
  4. centos 显示50g硬盘但是 实际大小很小_天啦噜!知道硬盘很慢,但没想到比 CPU Cache 慢 10000000 倍...
  5. creator图片循环显示_CocosCreator背景图循环播放
  6. python382怎么用_教你如何使用Python快速生成验证码
  7. iOS用三种途径实现一方法有多个返回值
  8. 不说“安全”俩字,如何证明自己是做安全的?
  9. 深度学习:GAN案例练习-minst手写数字
  10. 盘点下玩过的解谜游戏
  11. 从DT时代云栖大会聊聊恒生电子
  12. 运行服务器(Tomcat)但是到JDBC这一步,一直报错java.lang.NoClassDefFoundError: Could not initialize class DruidDemo
  13. 沃顿研究数据服务推出高级研究学者计划,为全球研究人员提供实地教育课程
  14. 编程为什么那么难:从储值卡扣款说起
  15. Java全栈开发---Java ERP系统开发:商业ERP(一)UML建模工具的使用
  16. Harbor: 企业级Registry的构建利器
  17. 软连接和硬链接的区别
  18. python语音处理_python处理语音
  19. Rosbag格式在线解压缩
  20. 计算机视觉——期末复习(简答题)

热门文章

  1. Mac如何查看JAVA_HOME
  2. mac 配置android home,mac上配置Android环境变量的方法
  3. 真正统治世界的十大算法
  4. 供应IBM 18P5814/8536/8646/5208/4445/3275_广东励康
  5. [TI TDA4 J721E]PROCESSOR-SDK-J721E Demo开发板运行与测试 基于 ubuntu 18.04
  6. 与“云”共舞,联想凌拓的新科技与新突破
  7. Go语言学习之path/filepath包(the way to go)
  8. unity+PHOTON+同步实例
  9. canvas实现分散对齐
  10. Android手机获取相机权限终极大招(兼容国产手机小米华为魅族以及6.0以下系统)