Hi there,
If I want to create email within my application (in production), how
is this best achieved??
Following the railsspace tutorial, it only really suggests to
use :smtp.
I’d read on another site that to generate emails locally, i need to
use :sendmail instead… However - I havent seen any decent examples
of how to get this configured to be able to send emails within my
local area.
Within my email_controller I have the following code:
def remind
@title = “Send me my login information”
if param_posted?(:user)
email = params[:user][:email]
user = User.find_by_email(email)
if user
UserMailer.deliver_reminder(user)
flash[:notice] = “Login information was sent.”
redirect_to :action => “index”, :controller => “site”
else
flash[:notice] = “There is no user with that email address.”
end
end
In environment.rb I have:
ActionMailer::Base.delivery_method = :sendmail
and at the top of the same file I have:
ENV[‘RAILS_ENV’] ||= ‘production’
When I try and enter an email address into the form:
I tget an error back:
SocketError in EmailController#remind
getaddrinfo: nodename nor servname provided, or not known
Has anyone else experienced this, and how do you get it up and
running?
Many Thanks