[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

SMTP example from docs is erroring out

Robert H

4/7/2005 12:43:00 PM

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

2 Answers

Eric Hodel

4/7/2005 5:27:00 PM

0

On 07 Apr 2005, at 05:44, sigzero@gmail.com 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.

You need to specify a hostname to attach to.

> 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://se...
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Robert H

4/7/2005 9:51:00 PM

0


Eric Hodel wrote:
> On 07 Apr 2005, at 05:44, sigzero@gmail.com 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. : )

> > 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://se...
> FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04