Skip to content

v1.0.1

Choose a tag to compare

@ludvikjerabek ludvikjerabek released this 03 Sep 14:26
· 1 commit to master since this release
ed6b0f6

Release v1.0.1

Welcome to version 1.0.1 of the Proofpoint Secure Email Relay Mail API Java Library.

What’s New

  • Added optional region selection via Region.US , Region. EU , and Region.AU . 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.US);

    // 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.0...v1.0.1