I am trying to send email from my comcast email account (say
[email protected]) to my yahoo email accout (say [email protected]) from a ruby
script using net/smtp:
require ‘net/smtp’
Net::SMTP.start(“smtp.comcast.net”, 25,“localhost”,“user”,“pass”) do
|smtp|
smtp.send_message “hello”,“[email protected]”,“[email protected]”
end
After trying the above ruby in irb I get the following message with no
email delivered:
=> “250 Mail queued for delivery.\n”
I don’t understand how the third argument to Net::SMTP.start should be
specified; its called “helo” and documentation says it defaults to
‘localhost.localdomain’. I would appreciate it if anyone could point out
what I am doing wrong.
I am pretty sure I have the smtp, pop3 and ports identified correctly
as I can send email using the command line utility postie
(http://www.infradig.com/postie/index.shtml):
postie -esmtp -host:smtp.comcast.net -to:[email protected]
-from:[email protected] -s:subject -msg:hello -user:user -pass:pass
#Incoming mail (POP3): mail.comcast.net
#Incoming mail (POP3): 110
#Outgoing mail (SMTP): smtp.comcast.net
#Outgoing mail (SMTP): port is set to 25