HTTP JavaMail Transport

An HTTP protocol provider for the JavaMail API that provides access to an SMTP server via an HTTP gateway, such as Mail Service.

To select this transport, set the mail.transport.protocol property to http.

If you would like the transport to throw a HttpTransportSuccessException on successful delivery of the email to the gateway, use the mail.http.reportsuccess property.

If the HTTP gateway returns a redirect response, the Location header will be available as a message header after the message is sent, and can be retrieved as follows:

String[] location = message.getHeader("Location");

The properties accepted by this provider include:

mail.http.urlStringThe URL of the mail service. If a username and password is provided within the URL, it will be passed as basic authentication. Both http and https URLs are supported.
mail.http.reportsuccessbooleanIf set to true, a HttpTransportSuccessException will be thrown on successful delivery, and the exception will contain details of the URL at which the delivery status can be queried.

Note that if you're using the "https" protocol to access HTTP over SSL, all the properties are still named "mail.http.*".