# What is wrong in my script?

**URL:** <https://www.ruby-forum.com/t/what-is-wrong-in-my-script/90682>\
**Category:** Ruby\
**Created:** [March 30, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/what-is-wrong-in-my-script/90682 "2007-03-30T23:48:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darth\_ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/22d042/32.png) [@darth\_ivan](https://www.ruby-forum.com/u/darth_ivan)\
**Post date:** [March 30, 2007, 11:48pm UTC](https://www.ruby-forum.com/t/what-is-wrong-in-my-script/90682/1 "2007-03-30T23:48:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![darth\_ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/22d042/32.png) [@darth\_ivan](https://www.ruby-forum.com/u/darth_ivan)\
**Post date:** [March 31, 2007, 12:01am UTC](https://www.ruby-forum.com/t/what-is-wrong-in-my-script/90682/2 "2007-03-31T00:01:04Z")

</div>

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](http://www.catb.org/~esr/faqs/smart-questions.html)

–  
Phillip “CynicalRyan” Gawlowski  
[http://cynicalryan.110mb.com/](http://cynicalryan.110mb.com/)

Rule of Open-Source Programming #8:

Open-Source is not a panacea.

---

<div class="post-metadata">

**Author:** ![darth\_ivan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/22d042/32.png) [@darth\_ivan](https://www.ruby-forum.com/u/darth_ivan)\
**Post date:** [March 31, 2007, 1:35am UTC](https://www.ruby-forum.com/t/what-is-wrong-in-my-script/90682/3 "2007-03-31T01:35:21Z")

</div>

On 3/30/07, Phillip G. [removed\_email\_address@domain.invalid](mailto: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/](http://talklikeaduck.denhaven2.com/)
