Interface EmailSender

All Superinterfaces:
org.teavm.jso.JSObject

public interface EmailSender extends org.teavm.jso.JSObject
An email sending binding. Declared with email(), named EMAIL by default.

Separate from the Mail handler: that receives, this sends. The destination has to be verified in the Cloudflare dashboard, and the sending domain has to be one the account controls.

SMTP is not an alternative. Cloudflare's own relay sits on a Cloudflare IP, and cloudflare:sockets refuses to connect to those, so a Worker cannot SMTP to Cloudflare Email Sending even with valid credentials. This binding and the REST API are the two ways out.

Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    send(String from, String to, String mime)
    Sends a message.
    default void
    send(String from, String to, String subject, String body)
    Sends a plain-text message, assembling the MIME.
    org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject>
    sendMessage(org.teavm.jso.JSObject message)
     

    Methods inherited from interface org.teavm.jso.JSObject

    cast
  • Method Details

    • send

      default void send(String from, String to, String mime)
      Sends a message.
      Parameters:
      from - the sender, on a domain the account controls
      to - the recipient, verified in the dashboard
      mime - the message as raw MIME
    • send

      default void send(String from, String to, String subject, String body)
      Sends a plain-text message, assembling the MIME.
      Parameters:
      from - the sender
      to - the recipient
      subject - the subject
      body - the body
    • sendMessage

      org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> sendMessage(org.teavm.jso.JSObject message)