org.springframework.mail.javamail

Class JavaMailSenderImpl

  • java.lang.Object
    • org.springframework.mail.javamail.JavaMailSenderImpl
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int DEFAULT_PORT
      The default port: -1.
      static java.lang.String DEFAULT_PROTOCOL
      The default protocol: 'smtp'.
    • Constructor Summary

      Constructors 
      Constructor and Description
      JavaMailSenderImpl()
      Create a new instance of the JavaMailSenderImpl class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      protected Transport connectTransport()
      Obtain and connect a Transport from the underlying JavaMail Session, passing in the specified host, port, username, and password.
      MimeMessage createMimeMessage()
      This implementation creates a SmartMimeMessage, holding the specified default encoding and default FileTypeMap.
      MimeMessage createMimeMessage(java.io.InputStream contentStream)
      Create a new JavaMail MimeMessage for the underlying JavaMail Session of this sender, using the given input stream as the message source.
      protected void doSend(MimeMessage[] mimeMessages, java.lang.Object[] originalMessages)
      Actually send the given array of MimeMessages via JavaMail.
      java.lang.String getDefaultEncoding()
      Return the default encoding for MimeMessages, or null if none.
      FileTypeMap getDefaultFileTypeMap()
      Return the default Java Activation FileTypeMap for MimeMessages, or null if none.
      java.lang.String getHost()
      Return the mail server host.
      java.util.Properties getJavaMailProperties()
      Allow Map access to the JavaMail properties of this sender, with the option to add or override specific entries.
      java.lang.String getPassword()
      Return the password for the account at the mail host.
      int getPort()
      Return the mail server port.
      java.lang.String getProtocol()
      Return the mail protocol.
      Session getSession()
      Return the JavaMail Session, lazily initializing it if hasn't been specified explicitly.
      protected Transport getTransport(Session session)
      Obtain a Transport object from the given JavaMail Session, using the configured protocol.
      java.lang.String getUsername()
      Return the username for the account at the mail host.
      void send(MimeMessage... mimeMessages)
      Send the given array of JavaMail MIME messages in batch.
      void send(MimeMessage mimeMessage)
      Send the given JavaMail MIME message.
      void send(MimeMessagePreparator... mimeMessagePreparators)
      Send the JavaMail MIME messages prepared by the given MimeMessagePreparators.
      void send(MimeMessagePreparator mimeMessagePreparator)
      Send the JavaMail MIME message prepared by the given MimeMessagePreparator.
      void send(SimpleMailMessage... simpleMessages)
      Send the given array of simple mail messages in batch.
      void send(SimpleMailMessage simpleMessage)
      Send the given simple mail message.
      void setDefaultEncoding(java.lang.String defaultEncoding)
      Set the default encoding to use for MimeMessages created by this instance.
      void setDefaultFileTypeMap(FileTypeMap defaultFileTypeMap)
      Set the default Java Activation FileTypeMap to use for MimeMessages created by this instance.
      void setHost(java.lang.String host)
      Set the mail server host, typically an SMTP host.
      void setJavaMailProperties(java.util.Properties javaMailProperties)
      Set JavaMail properties for the Session.
      void setPassword(java.lang.String password)
      Set the password for the account at the mail host, if any.
      void setPort(int port)
      Set the mail server port.
      void setProtocol(java.lang.String protocol)
      Set the mail protocol.
      void setSession(Session session)
      Set the JavaMail Session, possibly pulled from JNDI.
      void setUsername(java.lang.String username)
      Set the username for the account at the mail host, if any.
      void testConnection()
      Validate that this instance can connect to the server that it is configured for.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait