Kero van Gelder
12/29/2005 12:05:00 PM
On 2005-12-29, Dan Diebolt <dandiebolt@yahoo.com> wrote:
> --0-1020623145-1135855120=:46005
> Content-Type: text/plain; charset=iso-8859-1
> Content-Transfer-Encoding: quoted-printable
>
>>You may be getting caught by a spam filter.
>
> I can post email using postie so I can't see a problem with the basic c
> redentials being sent. There must be some configuration of Net::SMTP that
> will allow me to email from Ruby. Anyone have a clue what to do?
$ ri send_message
------------------------------------------------- Net::SMTP#send_message
send_message( msgstr, from_addr, *to_addrs )
------------------------------------------------------------------------
Sends msgstr as a message. Single CR ("\r") and LF ("\n") found in
the msgstr, are converted into the CR LF pair. You cannot send a
binary message with this method. msgstr should include both the
message headers and body.
"...both the message headers and the body" does not seem to be covered by a
string like "hello", in other words you are complying to SMTP but not to RFC
822. Lacking a From/Reply-To address you do not receive the Delivery Failure
message, I suppose. An (incomplete!) snippet from what I use:
header = [
"To: #{to.join(', ')}",
"Subject: #{subject}",
"Date: #{Time.now.rfc822}",
"From: Arena II <#{ArenaMail}>"
]
Net::SMTP.start("localhost", 25, SiteDNS) { |smtp|
smtp.sendmail(header.join("\n")+"\n\n"+msg, ArenaMail, rcpts)
}
(in which I should use \r\n but as the docs say, it does not matter)
Hth,
Kero.
PS: there are higher level mail libraries for Ruby, iirc.