I’ve managed to get a simple mail message sent to myself, but, it leaves
a lot to be desired. I get an e-mail from my server, to me, but, there’s
no body to the mail, even though I created some message text in a
“message” variable. Also, in the e-mail sent to me, the “to” field in
the e-mail is blank, with my e-mail address under cc: as a blind copy,
(bcc: Peter B./BNA Inc). Can someone help me put in a subject line,
and, get my timestamp to work as my e-mail body? And, I need to put the
name of the file that I’m telling people about in the subject line, too.
That’s in a variable.
If you install RubyMail or TMail via gems, you will need to require
‘rubygems’ as well as ‘rmail’ or ‘tmail’. Both of those are good tools,
but there is also MailFactory, which is easy to use:
require ‘mailfactory’
mail = MailFactory.new()
mail.to = "[email protected]"
mail.from = "Internet D. <[email protected]>"
mail.subject = "My, what big ears you have!"
mail.text = "Have you ever considered plastic surgery?"
Net::SMTP.start('localhost',25, 'otherserver.myorg.org',