SMTP example from docs is erroring out

require 'net/smtp'

msgbody = IO::readlines("M:/Program
Files/Mincom/ParadoxMaster/msqupd.log",nil)
msg = ["Subject: Test", "\n", msgbody]

Net::SMTP.start do |smtp|
  smtp.sendmail( msg, 'to_addr', ['frm_addr'] ) # these had actual
values
end

ArgumentError: wrong number of arguments (0 for 1)
        from (irb):4:in `start'
        from (irb):4
irb(main):007:0>

Robert

require 'net/smtp'

msgbody = IO::readlines("M:/Program
Files/Mincom/ParadoxMaster/msqupd.log",nil)
msg = ["Subject: Test", "\n", msgbody]

Net::SMTP.start do |smtp|

You don't say which docs you got this example from, but this does not match the examples in net/smtp.

You need to specify a hostname to attach to.

PGP.sig (194 Bytes)

···

On 07 Apr 2005, at 05:44, sigzero@gmail.com wrote:

  smtp.sendmail( msg, 'to_addr', ['frm_addr'] ) # these had actual
values
end

ArgumentError: wrong number of arguments (0 for 1)
        from (irb):4:in `start'
        from (irb):4

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Eric Hodel wrote:

> require 'net/smtp'
>
> msgbody = IO::readlines("M:/Program
> Files/Mincom/ParadoxMaster/msqupd.log",nil)
> msg = ["Subject: Test", "\n", msgbody]
>
> Net::SMTP.start do |smtp|

You don't say which docs you got this example from, but this does not

match the examples in net/smtp.

I downloaded the one-click installer and I have that in my docs. Not
exactly, since my stuff is in there.

You need to specify a hostname to attach to.

In the meantime, I found the answer as well. : )

···

On 07 Apr 2005, at 05:44, sigzero@gmail.com wrote:

> smtp.sendmail( msg, 'to_addr', ['frm_addr'] ) # these had actual
> values
> end
>
> ArgumentError: wrong number of arguments (0 for 1)
> from (irb):4:in `start'
> from (irb):4

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04