JavaScript is disabled on your browser.
javax.mail

Class Transport

  • Direct Known Subclasses:
    NNTPTransport, SMTPTransport


    public abstract class Transport
    extends Service 
    A message transport mechanism that can be used to deliver messages.
    • Constructor Detail

      • Transport

        public Transport(Session session,
         URLName url)
        Constructor.
        Parameters:
        session - the session context for this transport
        url - a URLName to be used for this transport
    • Method Detail

      • send

        public static void send(Message msg)
         throws MessagingException 
        Sends the specified message. The message will be sent to all recipient addresses specified in the message, using transports appropriate to each address (specified by the javamail.address.map resource).
        Parameters:
        msg - the message to send
        Throws:
        SendFailedException - if the message could not be sent to some or any of the recipients
        MessagingException
      • send

        public static void send(Message msg,
         java.lang.String username,
         java.lang.String password)
         throws MessagingException 
        Sends the specified message. The message will be sent to all recipient addresses specified in the message, using transports appropriate to each address (specified by the javamail.address.map resource).
        Parameters:
        msg - the message to send
        username - the name of the user to authenticate as
        password - the password of the user to authenticate as
        Throws:
        SendFailedException - if the message could not be sent to some or any of the recipients
        MessagingException
        Since:
        JavaMail 1.5
      • send

        public static void send(Message msg,
         Address[] addresses)
         throws MessagingException 
        Sends the message to the specified addresses, ignoring any recipients specified in the message itself.
        Parameters:
        msg - the message to send
        addresses - the addresses to which to send the message
        Throws:
        SendFailedException - if the message could not be sent to some or any of the recipients
        MessagingException
      • send

        public static void send(Message msg,
         Address[] addresses,
         java.lang.String username,
         java.lang.String password)
         throws MessagingException 
        Sends the message to the specified addresses, ignoring any recipients specified in the message itself.
        Parameters:
        msg - the message to send
        addresses - the addresses to which to send the message
        username - the name of the user to authenticate as
        password - the password of the user to authenticate as
        Throws:
        SendFailedException - if the message could not be sent to some or any of the recipients
        MessagingException
        Since:
        JavaMail 1.5
      • sendMessage

        public abstract void sendMessage(Message msg,
         Address[] addresses)
         throws MessagingException 
        Sends the message to the specified list of addresses.
        Parameters:
        msg - the message to be sent
        addresses - the addresses to send this message to
        Throws:
        SendFailedException - if the send failed because of invalid addresses
        MessagingException - if the transport is not connected
      • addTransportListener

        public void addTransportListener(TransportListener l)
        Adds a listener for transport events.
      • removeTransportListener

        public void removeTransportListener(TransportListener l)
        Removes a transport event listener.
      • notifyTransportListeners

        protected void notifyTransportListeners(int type,
         Address[] validSent,
         Address[] validUnsent,
         Address[] invalid,
         Message msg)
        Notifies all transport listeners.

AltStyle によって変換されたページ (->オリジナル) /