Welcome Guest | Login

ActionMailer - SMTP - "execution expired"

Hi -

I am trying to send an email to a user when they create an account, but i always get "execution expired". The mail seems to generate with the correct information (to, from, subject, body), but is never sent because something expires.  HELP PLEASE!

Here is my environment.rb:

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
 :address => "mail.mydomail.net",
 :port => 25,
 :domain => "domain.net",
 :user_name => "login+domain.net",
 :password => "password",
 :authentication => :login
}
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.default_content_type = "text/html"

Here is my controller:

def create_user
   @user = User.new(params[:user])
   if request.post? and @user.save
     flash.now[:notice] = "User #{@user.login} created"
     CustomerMailer.deliver_welcome_message(@user)
     mail = CustomerMailer.create_welcome_message(@user)
     CustomerMailer.deliver(mail)
     @user = User.new
   end
 end

2007-07-23 04:47 PM

Just use sendmail - its faster and won't timeout on you.

ActionMailer::Base.delivery_method = :sendmail
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.default_content_type = "text/html"

2007-07-23 05:48 PM

That fixes the timeout problem, but e-mails are still not sent.  I didn't mention before (sorry!) that I am testing this from a local machine - not the hostingrails machine.  How can I get e-mails sent from here?

2007-07-23 05:56 PM

Oh - whoops.  yeah - you'll need to use SMTP.....I wouldn't recommend sending emails out from your local box, however. Just set

ActionMailer::Base.perform_deliveries = false

and check your logs to see how it will look.  Then use sendmail on the server and set this back to true.

2007-07-23 06:01 PM

my app sends the email but I didn't received it.

here's my code

Notifier.rb

***************************************
class Notifier < ActionMailer::Base

def signup_thanks(user)
  recipients user.email
  from = "support@luluswap.com"
  subject = "Thank you for registering with Luluswap.com ! , Start swapping for free and have fun too ! "
  body       :account => user

end

end

******************************************************************88
member create method


**********************************************************************8
@member = Member.new(params[:member])
   
   if @member.save
     
     Notifier.deliver_signup_thanks(@member)    

******************************************************************8

Thanks in advance

2007-12-27 09:57 PM

jer
Are you sure the email was sent? What settings do you have in your environment.rb? Can you paste in the production.log?

2007-12-28 08:17 AM

Hello,

I'd like to tag on to this thread because my problem is related and one likely to be experience by other hostingrails account holders.

I've had emails sending and received using sendmail, but these emails have been marked as spam.   I'd like to configure my production.rb to use the SMTP mailer service.  I do not want to use sendmail because, according to my understanding, email sent by sendmail  is more likely to be marked as spam.  (Is this true?)

I have my main domain and an ADDONDOMAIN that I've developed a site for.  So my big question is how do I configure AR Mailer to use SMTP for my ADDONDOMAIN?

Here is my current configuration.  It is raising no errors, but no email seems to be delivered:


ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
  :domain             => "ADDONDOMAIN.com",
  :address            => 'mail.ADDONDOMAIN.com',
  :port               => 25
  :authentication => :login ,
  :user_name          => 'HOSTINGRAILS_ACCOUNT_LOGIN',
  :password           => 'HOSTINGRAILS_ACCOUNT_PASSWORD',
}

ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"
ActionMailer::Base.default_content_type = "text/html"

Are there any obvious flaws here?

EB

2008-09-14 10:56 AM

for the username and password it shouldn't be the HOSTINGRAILS_ACCOUNT info but rather the email account info you used when setting it up through cPanel.

2008-09-15 03:10 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!