module EMail

Defined in:

email.cr
email/address.cr
email/concurrent_sender.cr
email/mimetype.cr

Constant Summary

DEFAULT_SMTP_PORT = 25
VERSION = "0.6.5"

Class Method Summary

Class Method Detail

def self.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

[View source]
def self.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

[View source]