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(). NOTE: mail.smtp.user was previously used for this. |
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, but useful with multi-homed hosts where it's important to pick a particular local address to bind to. |
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. Normally failure of the EHLO command will fallback to the HELO command; this property exists only for servers that don't fail EHLO properly or don't implement EHLO properly. |
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, and the order in which to consider them. Only mechanisms supported by the server and supported by the current implementation will be used. The default is "LOGIN PLAIN DIGEST-MD5"
, which includes all the authentication mechanisms supported by the current implementation. |
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. See also the setSubmitter
method of SMTPMessage
. Mail clients typically do not use this. |
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.allow8bitmime |
boolean |
If set to true, and the server supports the 8BITMIME extension, text parts of messages that use the "quoted-printable" or "base64" encodings are converted to use "8bit" encoding if they follow the RFC2045 rules for 8bit text. |
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.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. Note also that this will cause a SendFailedException
to be thrown from the sendMessage
method of SMTPTransport
even if all addresses were correct and the message was sent successfully. |
mail.smtp.socketFactory |
SocketFactory |
If set to a class that implements the javax.net.SocketFactory
interface, this class will be used to create SMTP sockets. Note that this is an instance of a class, not a name, and must be set using the put
method, not the setProperty
method. |
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, check the server identity as specified by RFC 2595
. These additional checks based on the content of the server's certificate are intended to prevent man-in-the-middle attacks. Defaults to false. |
mail.smtp.ssl.socketFactory |
SSLSocketFactory |
If set to a class that extends the javax.net.ssl.SSLSocketFactory
class, this class will be used to create SMTP SSL sockets. Note that this is an instance of a class, not a name, and must be set using the put
method, not the setProperty
method. |
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.ssl.ciphersuites |
string |
Specifies the SSL cipher suites that will be enabled for SSL connections. The property value is a whitespace separated list of tokens acceptable to the javax.net.ssl.SSLSocket.setEnabledCipherSuites
method. |
mail.smtp.mailextension |
String |
Extension string to append to the MAIL command. The extension string can be used to specify standard SMTP service extensions as well as vendor-specific extensions. Typically the application should use the SMTPTransport
method supportsExtension
to verify that the server supports the desired service extension. See RFC 1869
and other RFCs that define specific extensions. |
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. Note that an appropriate trust store must configured so that the client will trust the server's certificate. 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.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. |
相关推荐
导入到Myeclipse 即可运行 测试使用的是QQ邮箱 在application.xml中配置的发送邮箱 要到邮箱中设置 POP3/SMTP服务为开。项目不部署到tomcat后启动服务,然后运行test.java 就发送了,。绝对可以发送
数据库:sqlserver CreateHtmlTable中的生成路径和SendService中的上传路径改成自己的
spring里配置javamail支持ftl模板,支持异步发送最大支持1000份,可以带多份附件
最早期的时候我们会使用JavaMail相关api来写发送邮件的相关代码,后来spring推出了JavaMailSender更加简化了邮件发送的过程,在之后springboot对此进行了封装就有了现在的spring-boot-starter-mail。 一、注册并登录...
最早期的时候我们会使用JavaMail相关api来写发送邮件的相关代码,后来spring推出了JavaMailSender更加简化了邮件发送的过程,在之后springboot对此进行了封装就有了现在的spring-boot-starter-mail。
Spring提供了非常好用的JavaMailSender接口实现邮件发送。在Spring Boot的Starter模块中也为此提供了自动化配置。下面通过实例看看如何在Spring Boot中使用JavaMailSender发送邮件。
6.8.3. 使用Spring IoC来配置AspectJ的切面 6.8.4. 在Spring应用中使用AspectJ Load-time weaving(LTW) 6.9. 其它资源 7. Spring AOP APIs 7.1. 简介 7.2. Spring中的切入点API 7.2.1. 概念 7.2.2. 切入点实施 ...
使用JPA访问数据库 第12章 整合其他ORM框架 第4篇 业务层应用 第13章 任务调度和异步执行器 第14章 JavaMail发送邮件 第15章 在Spring中使用JMS 第16章 在Spring中开发Web Service 第17章 使用...
6.8.3. 使用Spring IoC来配置AspectJ的切面 6.8.4. 在Spring应用中使用AspectJ Load-time weaving(LTW) 6.9. 其它资源 7. Spring AOP APIs 7.1. 简介 7.2. Spring中的切入点API 7.2.1. 概念 7.2.2. 切入点...
Spring3.0是Spring在积蓄了3年之久后,隆重推出的一个重大升级版本,进一步加强了Spring作为Java领域第一开源平台的翘楚地位。 Spring3.0引入了众多Java...附录A JavaMail发送邮件 附录B 在Spring中开发Web Service
使用java mail 包 spring mvc 配置方法发送邮箱的实现方法
6.8.3. 使用Spring IoC来配置AspectJ的切面 6.8.4. 在Spring应用中使用AspectJ Load-time weaving(LTW) 6.9. 其它资源 7. Spring AOP APIs 7.1. 简介 7.2. Spring中的切入点API 7.2.1. 概念 7.2.2. 切入点...
使用JPA访问数据库 第12章 整合其他ORM框架 第4篇 业务层应用 第13章 任务调度和异步执行器 第14章 JavaMail发送邮件 第15章 在Spring中使用JMS 第16章 在Spring中开发Web Service 第17章 使用...
使用JPA访问数据库 第12章 整合其他ORM框架 第4篇 业务层应用 第13章 任务调度和异步执行器 第14章 JavaMail发送邮件 第15章 在Spring中使用JMS 第16章 在Spring中开发Web Service 第17章 使用...
本博客介绍基于SSM框架(Spring4.0+SpringMVC+Mybatis)组合的Javamail应用,邮箱的话基于腾讯的QQ邮箱,其实也是Foxmail邮箱 先要了解一下SMTP协议和SSL加密 SMTP:称为简单邮件传输协议(Simple Mail Transfer ...
Spring3.0是Spring在积蓄了3年之久后,隆重推出的一个重大升级版本,进一步加强了Spring作为Java领域第一开源平台的翘楚地位。 Spring3.0引入了众多Java...附录A JavaMail发送邮件 附录B 在Spring中开发Web Service
这是一个示例应用程序,显示了如何使用Spring和Thymeleaf编写和发送动态电子邮件。 使用Thymeleaf,您可以轻松编写文本和HTML电子邮件。 要了解有关Thymeleaf的更多信息并下载最新版本,请访问 为了运行该应用...
用maven搭建项目,实现java邮件发送功能,用spring做对象管理和配置管理; maven可以package,install等等;携带所有jar包
- 在Controller中使用@PreAuthorize等注解需要在spring-web配置文件中扫描security包下的类 6. 引用application.properties中的属性的方式:@ConfigurationProperties(prefix = "spring.mail") + @Component + ...