M
Michael Linfield
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 <[email protected]>
To: Someone <[email protected]>
Subject: Test SMTP
i pray that itll work
MESSAGE_END
Net::SMTP.start('mx1.hotmail.com') do |smtp|
smtp.send_message message, '(e-mail address removed)', '(e-mail address removed)'
end
#####
This was one example, i receive no errors indicating a problem but when
checking my email IE: (e-mail address removed) 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?
net smtp and i never really get the emails.
require 'net/smtp'
message = <<MESSAGE_END
From: Nobody <[email protected]>
To: Someone <[email protected]>
Subject: Test SMTP
i pray that itll work
MESSAGE_END
Net::SMTP.start('mx1.hotmail.com') do |smtp|
smtp.send_message message, '(e-mail address removed)', '(e-mail address removed)'
end
#####
This was one example, i receive no errors indicating a problem but when
checking my email IE: (e-mail address removed) 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?