Re: What is wrong in my script?
- From: Phillip Gawlowski <cmdjackryan@xxxxxxxxxxxxxx>
- Date: Sat, 31 Mar 2007 07:00:36 +0900
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.
.
- Follow-Ups:
- Re: What is wrong in my script?
- From: Rick DeNatale
- Re: What is wrong in my script?
- References:
- What is wrong in my script?
- From: Ivan Vieira
- What is wrong in my script?
- Prev by Date: What is wrong in my script?
- Next by Date: Re: simple gsub question \' \` what?
- Previous by thread: What is wrong in my script?
- Next by thread: Re: What is wrong in my script?
- Index(es):
Relevant Pages
|