"
+ exit 1
+end
+
+
+mail = Mail.new
+mail.to = to
+mail.from = from
+mail.subject = "A test email from #{Time.now.to_s}"
+mail['X-Postal-Tag'] = 'send-html-email-script'
+mail.text_part = Mail::Part.new do
+ body <<~BODY
+ Hello there.
+
+ This is an example. It doesn't do all that much.
+
+ Some other characters: őúéáűí
+
+ There is a link here through... https://postalserver.io/test-plain-text-link?foo=bar&baz=qux
+ BODY
+end
+mail.html_part = Mail::Part.new do
+ content_type 'text/html; charset=UTF-8'
+ body <<~BODY
+ Hello there
+ This is an example email. It doesn't do all that much.
+ Some other characters: őúéáűí
+ There is a link here though...
+ BODY
+end
+
+#puts mail.to_s
+
+Net::SMTP.start('127.0.0.1', 2525) do |smtp|
+ smtp.send_message mail.to_s, mail.from.first, mail.to.first
+end
+
+puts "Sent"