API Explorer 936 endpoints

Send Self Test Email

POST /obp/v7.0.0/management/self-test-emails

OBPv7.0.0-createTestEmail Roles: CanCreateTestEmail EmailSystem

Send a test email to the authenticated user's own email address.

Useful for admins to verify that emails sent during user signup, email validation and password reset can actually be delivered. This endpoint uses the same From address and the same SMTP path as those flows, so a successful result here is a strong signal that those flows will work too.

The From address comes from AuthUser.emailFrom, which reads the property mail.users.userinfo.sender.address. The endpoint fails with 500 if this is still the default noreply@example.com, because most SMTP servers will reject that From address.

The endpoint also fails with 500 if portal_external_url is not set, because that property is required to build the links embedded in signup-validation and password-reset emails. Without it, those flows silently skip sending. The configured value (or (unset)) is included in the body of the test email so the admin can confirm visually.

The recipient is always the caller's own email address — there is no to parameter. The role CanCreateTestEmail is required.

Returns the recipient, sender, subject and the message-id assigned by the SMTP server. If the email cannot be sent, returns 500 with the most specific OBP error code for the underlying cause:

  • $SmtpAuthenticationFailed — credentials rejected by the SMTP server
  • $SmtpConnectionFailed — TCP connect failed (host unreachable, port closed, timeout, DNS resolution failure)
  • $SmtpTlsHandshakeFailed — STARTTLS/SSL handshake failed (protocol mismatch, untrusted certificate)
  • $SmtpRecipientRejected — server accepted the connection but rejected the recipient, message, or From address
  • $SmtpProtocolError — other Jakarta Mail protocol-level error
  • $EmailSendingFailed — fallback when the underlying cause does not match any of the above

In all cases the underlying exception chain (class name and message) is appended after Detail: so the operator can diagnose without server logs.

User Authentication is Required. The User must be logged in. The Application must also be authenticated.

JSON request body fields (0)
JSON response body fields (4)
from
message_id
message_id
subject
subject
to
Example success response
{
  "to": "alice@example.com",
  "from": "noreply@openbankproject.com",
  "subject": "OBP test email from openbankproject.com",
  "message_id": "<abc123@smtp.example.com>"
}
Possible errors (11)
  • OBP-20001: User not logged in. Authentication is required!
  • OBP-20006: User is missing one or more roles:
  • OBP-30339: User does not have an email address set. Cannot send test email.
  • OBP-10056: A required server configuration property is missing.
  • OBP-30341: SMTP authentication failed. Check mail.smtp.user and mail.smtp.password.
  • OBP-30342: Could not connect to SMTP server. Check mail.smtp.host, mail.smtp.port and network reachability.
  • OBP-30343: TLS handshake with SMTP server failed. Check mail.smtp.starttls.enable, mail.smtp.ssl.enable and mail.smtp.ssl.protocols.
  • OBP-30344: SMTP server rejected the recipient or message. The From address may be unauthorised, the recipient may be invalid, or the message may have failed policy/anti-spam checks.
  • OBP-30345: SMTP protocol error from the mail server.
  • OBP-30340: Failed to send email. Check the server logs and SMTP configuration.
  • OBP-50000: Unknown Error.
Implemented by OBPv7.0.0 createTestEmail