Interface MailMessage

All Superinterfaces:
org.teavm.jso.JSObject

public interface MailMessage extends org.teavm.jso.JSObject
Cloudflare's ForwardableEmailMessage.

InboundMail is what a handler sees. This is the JavaScript object behind it, and it is the surface to reach for when something about a message is not exposed there.

Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject>
    forward(String address)
    Sends the message on to a verified destination address.
    Returns the envelope sender.
    Returns the message headers.
    org.teavm.jso.JSObject
    Returns the raw MIME message, as a stream.
    int
    Returns the size of the raw message in bytes.
    Returns the envelope recipient.
    org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject>
    reply(org.teavm.jso.JSObject message)
    Answers the message in the same SMTP session.
    void
    setReject(String reason)
    Refuses the message with a permanent SMTP error.

    Methods inherited from interface org.teavm.jso.JSObject

    cast
  • Method Details

    • getFrom

      String getFrom()
      Returns the envelope sender.
      Returns:
      the envelope sender
    • getTo

      String getTo()
      Returns the envelope recipient.
      Returns:
      the envelope recipient
    • getHeaders

      Headers getHeaders()
      Returns the message headers.
      Returns:
      the message headers
    • getRaw

      org.teavm.jso.JSObject getRaw()
      Returns the raw MIME message, as a stream.
      Returns:
      the raw MIME message, as a stream
    • getRawSize

      int getRawSize()
      Returns the size of the raw message in bytes.
      Returns:
      the size of the raw message in bytes
    • setReject

      void setReject(String reason)
      Refuses the message with a permanent SMTP error.
      Parameters:
      reason - returned to the sending server
    • forward

      org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> forward(String address)
      Sends the message on to a verified destination address.
      Parameters:
      address - the destination
      Returns:
      settles once Cloudflare has accepted the forward
    • reply

      org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> reply(org.teavm.jso.JSObject message)
      Answers the message in the same SMTP session.
      Parameters:
      message - the reply
      Returns:
      settles once Cloudflare has accepted the reply