Module: MailMCP::SmtpClient
- Defined in:
- lib/mail_mcp/smtp_client.rb
Defined Under Namespace
Classes: ConnectionError
Class Method Summary collapse
Class Method Details
.send(config, mail) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/mail_mcp/smtp_client.rb', line 11 def self.send(config, mail) smtp_open(config) do |s| s.(mail.to_s, mail.from.first, mail.to) end rescue Net::SMTPError, SocketError => e raise ConnectionError, "SMTP send failed: #{e.}" end |
.validate!(config) ⇒ Object
7 8 9 |
# File 'lib/mail_mcp/smtp_client.rb', line 7 def self.validate!(config) smtp_open(config) { nil } end |