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. |
相关推荐
在本篇文章中,我们将深入探讨如何利用Spring来实现JavaMail邮件发送,以及在实际应用中需要注意的关键点。 首先,我们需要理解JavaMail API的基础概念。JavaMail是一个用于处理邮件的开放源码API,它允许开发者...
导入到Myeclipse 即可运行 测试使用的是QQ邮箱 在application.xml中配置的发送邮箱 要到邮箱中设置 POP3/SMTP服务为开。项目不部署到tomcat后启动服务,然后运行test.java 就发送了,。绝对可以发送
总之,这个实例结合了Struts2、Spring和Mybatis的强大功能,提供了一个完整的邮件发送系统,包括邮件的创建、附件上传和数据库操作。对这个实例的学习和实践,可以帮助开发者深入理解Java企业级应用的开发流程和技巧...
当我们需要在Spring应用中实现邮件发送功能时,通常会整合Spring与JavaMail。下面将详细讲解如何利用Spring整合JavaMail发送QQ邮件。 首先,我们需要在项目中引入JavaMail的相关依赖。在Maven项目中,可以在pom.xml...
【javamail邮件发送项目】是一个基于Java技术的邮件发送解决方案,主要利用Spring框架进行配置,结合FreeMarker(FTL)模板技术实现邮件内容的动态生成,并具备异步发送及批量处理邮件的能力,最多可同时处理1000份...
总结起来,Spring结合JavaMail API发送邮件的过程主要包括:配置`JavaMailSender` bean,创建邮件消息对象,设置邮件内容和属性,最后通过`JavaMailSender`实例发送邮件。通过这种方式,开发者可以轻松地在Spring...
2. 配置Spring:在Spring的配置文件(如`applicationContext.xml`)中,你需要声明Quartz的相关bean,如`SchedulerFactoryBean`,以及你的邮件发送Job和Trigger。 3. 定义邮件发送Job:创建一个Job类,实现`execute...
### 在Spring中结合JavaMail与Quartz实现定时邮件发送 #### 概述 在Web开发领域,自动化定时任务是常见的需求之一,例如自动发送报告、更新数据或进行系统维护等。Spring框架因其强大的功能和灵活性,成为了实现...
同时,还需要定义一个`SimpleMailMessage` bean,用于设置邮件的基本信息,如收件人、发件人和主题: ```xml <bean id="mailmessage" class="org.springframework.mail.SimpleMailMessage"> ``` 接下来,...
通常,它会包含一个邮件发送服务类,该类注入`JavaMailSender`,并提供一个方法来创建并发送邮件。例如: ```java @Service public class MailService { @Autowired private JavaMailSender mailSender; public ...
接下来,我们可以创建一个服务类来处理邮件发送的具体逻辑,使用`JavaMailSender`发送邮件: ```java @Service public class EmailService { @Autowired private JavaMailSender mailSender; public void ...
### Spring结合JavaMail开发文档知识点...通过上述知识点的学习,开发者可以更加高效地利用Spring与JavaMail组合来实现邮件发送的功能,无论是简单的纯文本邮件还是复杂的HTML邮件甚至是带有附件的邮件都能轻松应对。
接下来,配置Spring的邮件发送服务。这通常在应用的配置文件(如`application.properties`或`application.yml`)中完成,设置SMTP服务器的属性,包括主机名、端口、用户名、密码等: ```properties # application....
这通常通过添加`spring-context-support`依赖来完成,该依赖包含了处理邮件发送所需的类。在Maven项目中,可以在pom.xml文件中添加以下依赖: ```xml <groupId>org.springframework <artifactId>spring-context-...
### Spring 3.x企业应用开发实战之JavaMail发送邮件知识点详解 #### 一、JavaMail基础知识的...Spring通过对JavaMail的支持,不仅简化了邮件发送的流程,还提高了开发效率,使得开发者能够更加专注于业务逻辑的实现。
总的来说,Spring通过`JavaMailSender`接口和相关的辅助类简化了邮件发送的过程,使得开发者无需深入理解复杂的JavaMail API就能轻松处理各种邮件需求。无论是对于初学者还是经验丰富的开发者,这都是一个非常实用的...
总的来说,这个示例展示了一个基于Spring框架和JavaMail API的邮件发送系统,包括如何配置邮件服务器、创建邮件对象、处理附件以及异步发送邮件。这个系统可以轻松地集成到任何Spring应用程序中,提供灵活且可靠的...
JavaMail是一种在Java环境下处理电子邮件的强大工具,它提供了丰富的API,允许开发者发送、接收和管理邮件。这个压缩包文件中的"16_sendmail"可能包含了用于演示如何使用JavaMail发送邮件的源代码。 JavaMail的核心...