-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsend.rb
More file actions
47 lines (43 loc) · 1.01 KB
/
send.rb
File metadata and controls
47 lines (43 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Example: sending the built email using the mail gem.
#
# Install: gem install mail (or uncomment in Gemfile)
# Then configure SMTP settings below.
#
# Alternatives:
# - ActionMailer (Rails)
# - Postmark: postmark gem
# - SendGrid: sendgrid-ruby gem
# require "mail"
html = File.read("dist/welcome-merged.html")
text = File.read("dist/welcome.txt")
# Mail.defaults do
# delivery_method :smtp, {
# address: "smtp.example.com",
# port: 587,
# user_name: "your-username",
# password: "your-password",
# authentication: :plain,
# enable_starttls_auto: true,
# }
# end
#
# mail = Mail.new do
# from "noreply@example.com"
# to "alice@example.com"
# subject "Welcome!"
#
# text_part do
# body text
# end
#
# html_part do
# content_type "text/html; charset=UTF-8"
# body html
# end
# end
#
# mail.deliver!
# puts "sent"
puts "SMTP config not set — edit send.rb with your credentials."
puts "HTML length: #{html.length} bytes"
puts "Text length: #{text.length} bytes"