Forum: Ruby What is wrong in my script?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ivan V. (Guest)
on 2007-03-31 01:48
require 'net/smtp'

def send_email(from, from_alias, to, to_alias, subject, message)
  msg = <<END_OF_MESSAGE
From: #{from_alias} <#{from}>
To: #{to_alias} <#{to}>
Subject: #{subject}

#{message}
END_OF_MESSAGE

  Net::SMTP.start("smpt.server", 25) do |smtp|
    smtp.send_mail msg, from, to
  end
end

send_email("from", "from_alias", "to", "to_alias", "subject", "message")
Phillip G. (Guest)
on 2007-03-31 02:01
(Received via mailing list)
Ivan V. wrote:
>
>   Net::SMTP.start("smpt.server", 25) do |smtp|
>     smtp.send_mail msg, from, to
>   end
> end
>
> send_email("from", "from_alias", "to", "to_alias", "subject", "message")
>

These are wild guess, due to the lack of error messages:
  - No authentication provided to the mail server
  - The RCPT email doesn't exist
  - No HELO provided
  - No SMTP server available at the address
  - No network connection
  - Wrong port

How to ask questions that can be answered in a more helpful manner:
http://www.catb.org/~esr/faqs/smart-questions.html

--
Phillip "CynicalRyan" Gawlowski
http://cynicalryan.110mb.com/

Rule of Open-Source Programming #8:

Open-Source is not a panacea.
Rick D. (Guest)
on 2007-03-31 03:35
(Received via mailing list)
On 3/30/07, Phillip G. <removed_email_address@domain.invalid> wrote:
> > END_OF_MESSAGE
>   - No authentication provided to the mail server
>   - The RCPT email doesn't exist
>   - No HELO provided
>   - No SMTP server available at the address
>   - No network connection
>   - Wrong port

And "from", "from_alias", "to", and "to_alias" don't look like valid
e-mail addresses.

Now can someone please tell me the winning numbers in the next big
powerball lottery?

--
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/
This topic is locked and can not be replied to.