Michael Linfield wrote: > Ive tried several examples from numerous books trying to send mail with > net smtp and i never really get the emails. > > require 'net/smtp' > > message = <<MESSAGE_END > From: Nobody <nobody / power.net> > To: Someone <someone / hotmail.com> > Subject: Test SMTP > > i pray that itll work > MESSAGE_END > > Net::SMTP.start('mx1.hotmail.com') do |smtp| > smtp.send_message message, 'nobody / power.net', 'someone / hotmail.com' > end > > ##### > This was one example, i receive no errors indicating a problem but when > checking my email IE: someone / hotmail.com i dont have it in any > folders, not inbox or junkmail. > > Another version that i modified to fit my own needs was this ---- > > require 'net/smtp' > > puts "Sender: " > sender = gets.chomp > puts "Recipient: " > rcpt = gets.chomp > puts "Message: " > msg = gets.chomp > > smtp = Net::SMTP.new('mx1.hotmail.com') > > smtp.start() > > smtp.ready(sender, rcpt) do |mail| > > mail.write msg > > end > > ######### > once again no errors > > any ideas why i might not be getting the emails? Does hotmail even allow SMTP usage? I noticed you were trying to connect to the server mx1.hotmail.com. Try this with a GMail account or other account, it should work. The following is part of a script that worked for me, though I haven't tested it in 6 months. Ruby 1.8 doesn't support TLS, so I had to require a file "smtp_tls.rb" that you can find on the web. You won't need it if your server doesn't require TLS. #!/usr/bin/env ruby require 'net/smtp' require 'smtp_tls' myMessage = <<END_OF_MESSAGE From: XXXXXXX <your_address / gmail.com> To: XXXXXX <someone / example.com> Subject: XXXXX XXXXXX This e-mail is a test. END_OF_MESSAGE Net::SMTP.start('smtp.gmail.com', 587, 'localhost.localdomain', username, password, :login) do |smtp| smtp.send_message(myMessage, 'your_address / gmail.com', ['someone / example.com']); end __END__ Good luck, Dan