The responsibility of the subject is not that of the SMTP protocol. It is held in one of the SMTP commands, which is to say DATA
and as such, is not relevant in responsibility to that library.
However, the DATA
will contain either proper (specification indicated) headers, or even some headers that are not specified, but not disallowed. PGP
According to RFC 5321 (and as expected) "Server SMTP systems SHOULD NOT reject messages based on perceived defects in the RFC 822 or MIME (RFC 2045 [21]) message header section or message body.".
So, your answer is going to be: "You don't set the subject by using that." But you would set the DATA with that information in it.
And the documentation that you linked to has an example of doing exactly that:
msgstr = <<END_OF_MESSAGE
From: Your Name <your@mail.address>
To: Destination Address <someone@example.com>
Subject: test message
Date: Sat, 23 Jun 2001 16:26:43 +0900
Message-Id: <unique.message.id.string@example.com>
This is a test message.
END_OF_MESSAGE
require 'net/smtp'
Net::SMTP.start('your.smtp.server', 25) do |smtp|
smtp.send_message msgstr,
'your@mail.address',
'his_address@example.com'
end
Documentation not linked here, as you have already provided the link.