Release v1.0.2
Welcome to version 1.0.1 of the Proofpoint Secure Email Relay Mail API Java Library.
What’s New
- Added Canada region selection via Region.CA. The default region is US when no value is specified.
import io.pfpt.ser.mail.*;
public class Example {
public static void main(String[] args) {
// Initialize the Client with OAuth credentials from the config.
// Default region when not specified is Region.US
Client client = new Client("<client_id>", "<client_secret>", Region.CA);
// Use the fluent builder to construct and send an email
Message message = Message.builder()
.subject("This is a test email")
.from("sender@example.com", "Joe Sender")
.addContent("This is a test message", Content.ContentType.TEXT)
.addTo("recipient1@example.com", "Recipient 1")
.build();
// Send the message asynchronously and wait for the result
SendResult sendResult = client.send(message).join();
// Output the HTTP status code from the API response
System.out.println("HTTP Status: " + sendResult.getHttpResponse().statusCode());
// Output the message ID from the API response
System.out.println("Message ID: " + sendResult.getMessageId());
// Output the reason (if any) from the API response
System.out.println("Reason: " + sendResult.getReason());
// Output the request ID from the API response
System.out.println("Request ID: " + sendResult.getRequestId());
}
}Breaking Changes
- None
Full Changelog: v1.0.1...v1.0.2