docs

Home All functions Legacy functions Categories

Purpose

vuMailLastReturnCode() returns a numeric code that describes what happened in the most recent completed send or gated vuMailKit operation.

This is intended to be machine-readable, so calling code can react without parsing vuMailLastError() text.

When to call it

Call this after a send has completed or after a gated vuMailKit function returns a negative licensing/setup code, for example:

Return values

These codes supplement the legacy return codes from vuSendMail*().

Value Meaning
0 No additional detail available, or success.
-451 Conflicting .NET mail/runtime files were detected in the application folder. Clean up the app folder before troubleshooting license or mail-provider settings.
-9001 vuMailKit licensing was not initialized.
-9002 License string is invalid or initialization failed.
-9003 Current license tier does not allow the requested feature.
-701 OAuth needs re-authorization. The refresh token is invalid, expired, or revoked.
-702 OAuth temporary failure. Retry later, such as a temporary network, provider, or throttling problem.
-711 Provider or mail server could not be reached.
-712 SMTP authentication or provider sign-in was rejected.
-713 Provider rejected the message.

Notes:

Clarion prototype

Prototype: vuMailLastReturnCode(), LONG, PROC, PASCAL, RAW, NAME(‘vuMailLastReturnCode’)

Example (Clarion)

  WaitRC  LONG
  LastRC  LONG
  LastMsg CSTRING(2048)

  WaitRC = vuSendMailWait(cFrom,cTo,cCC,cBCC,cSubject,cBody,cAttach)

  LastRC = vuMailLastReturnCode()
  LastMsg = vuMailLastError()

  IF (LastRC = -701)
    MESSAGE('OAuth needs re-authorization.|' & LastMsg,'vuMailKit',ICON:Exclamation)
  ELSIF (LastRC = -702)
    MESSAGE('Temporary OAuth failure.|' & LastMsg,'vuMailKit',ICON:Exclamation)
  ELSIF (LastRC = -711)
    MESSAGE('The mail server could not be reached.|' & LastMsg,'vuMailKit',ICON:Exclamation)
  ELSIF (LastRC = -712)
    MESSAGE('The server rejected the sign-in.|' & LastMsg,'vuMailKit',ICON:Exclamation)
  ELSIF (LastRC = -713)
    MESSAGE('The server rejected the message.|' & LastMsg,'vuMailKit',ICON:Exclamation)
  END
Home All functions Legacy functions Categories