What is wrong in my script?

Discussion in 'Ruby' started by Ivan Vieira, Mar 30, 2007.

  1. Ivan Vieira

    Ivan Vieira Guest

    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")

    --
    Posted via http://www.ruby-forum.com/.
    Ivan Vieira, Mar 30, 2007
    #1
    1. Advertising

  2. Ivan Vieira wrote:
    > 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")
    >


    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.
    Phillip Gawlowski, Mar 30, 2007
    #2
    1. Advertising

  3. On 3/30/07, Phillip Gawlowski <> wrote:
    > Ivan Vieira wrote:
    > > 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")
    > >

    >
    > 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


    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/
    Rick DeNatale, Mar 31, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Miguel Dias Moura
    Replies:
    4
    Views:
    3,301
    Miguel Dias Moura
    Jun 23, 2004
  2. Matthew
    Replies:
    7
    Views:
    670
    Priscilla Walmsley
    Jan 7, 2005
  3. Rajat
    Replies:
    3
    Views:
    696
    Jorgen Grahn
    Jan 8, 2010
  4. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    555
    Jan Kaliszewski
    Jan 7, 2010
  5. kath
    Replies:
    4
    Views:
    585
    J. Gleixner
    Apr 9, 2007
Loading...

Share This Page