What is wrong in my script?

I

Ivan Vieira

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

Phillip Gawlowski

Ivan said:
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.
 
R

Rick DeNatale

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

net/smtp 3
send email in ruby 12
Threading an email queueing system 1
Simple SMTP server in ruby 2
net/smtp 6
Problems sending mail 0
Problem with SMTP mail program 3
Mail Using SMTP Problem 2

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top