module

EMail

Constants

DEFAULT_SMTP_PORT = 25
VERSION = "0.7.1"

Class methods

send(config : EMail::Client::Config, &)

Sends one email with given client settings as EMail::Client::Config object.

config = EMail::Client::Config.new("your.mx.server.name", 587)
config.use_tls
config.use_auth("your_id", "your_password")

EMail.send(config) do
  # In this block, default receiver is EMail::Message object
  from "your@mail.addr"
  to "to@some.domain"
  subject "Subject of the mail"

  message <<-EOM
    Message body of the mail.

    --
    Your Signature
    EOM
end
Source
send(*args, **named_args, &)

Sends one email with given client settings as several arguments.

Avairable arguments are same as EMail::Client::Conifg.create method.

EMail.send("your.mx.server.name", 578,
  use_tle: true,
  auth: {"your_id", "your_password"}) do
  # In this block, default receiver is EMail::Message object
  from "your@mail.addr"
  to "to@some.domain"
  subject "Subject of the mail"

  message <<-EOM
    Message body of the mail.

    --
    Your Signature
    EOM
end
Source

Nested types