Mailer Behaviour Error

Hi.

I have just installed the Mailer behaviour for Radiant CMS.

My hosting is with A Small Orange.

When trying to test the form I get the error:

“Error encountered while trying to send email. 550 Administrative
prohibition”

I have added the config part to the page and also in the environment.rb
file I added the code shown below (obviously with my own settings):

ActionMailer::Base.server_settings = {
:address => “mydomain.com”,
:port => 25,
:domain => ‘mydomain.com’,
:user_name => “username”,
:password => ‘****’,
:authentication => :login
}

Any ideas?

Same problem here, I wasn’t able to make it work.

2007/1/26, Oliver C. [email protected]:

Ok, so I have it working now - it will send an email.

It seemed that the thing it didn’t like was the email address that I
used in the config part.

I am still having a problem tho - how do I create the body (main text of
the email) from my form?

I was using an email part of the Contact pag with this in it, but the
email comes thru empty with a text file attached containing the form
data…

<r:mailer:get name=“name”/> submitted the following:
mesage = <r:mailer:get name=“message”/>

Oliver,

In the mailer extension, I chose to change the way that the email was
being
sent from how Matt originally did it in the behavior. For the most part
and
in most email clients, it works just fine, and I had used this format in
a
previous Rails application that sent email. If someone can find me a
more
robust way of creating gracefully degrading emails, I’d be delighted to
change it.

Sean

Sorry Sean, what do you mean by your post exactly? Is that just the way
it is, that it will come thru as a text file?

I am using Hotmail to view the email - will that have any effect?

Sean C. wrote:

Oliver,

In the mailer extension, I chose to change the way that the email was
being
sent from how Matt originally did it in the behavior. For the most part
and
in most email clients, it works just fine, and I had used this format in
a
previous Rails application that sent email. If someone can find me a
more
robust way of creating gracefully degrading emails, I’d be delighted to
change it.

Sean

Oh, I see what you mean. Use the subject: line in your ‘config’ part,
just
as you do for the from, recipients, etc.

Sean

My config part is at follows:

mailers:
contact:
subject: Contact Form
from: ***@***.com
redirect_to: /contact/thank-you/
recipients:
- ***@***.com

But it doesn’t seem to make any difference to the subject line?

Sean C. wrote:

Oh, I see what you mean. Use the subject: line in your ‘config’ part,
just
as you do for the from, recipients, etc.

Sean

I opened the email using Thunderbird and it apearred fine.

However, the subject of the email comes thru as:

“Form Mail from www.aromatherapymassageyeovil.co.uk

Am I able to change this somehow?

Oliver C. wrote:

Sorry Sean, what do you mean by your post exactly? Is that just the way
it is, that it will come thru as a text file?

I am using Hotmail to view the email - will that have any effect?

Sean C. wrote:

Oliver,

In the mailer extension, I chose to change the way that the email was
being
sent from how Matt originally did it in the behavior. For the most part
and
in most email clients, it works just fine, and I had used this format in
a
previous Rails application that sent email. If someone can find me a
more
robust way of creating gracefully degrading emails, I’d be delighted to
change it.

Sean

Oh, I’m sorry. You’re using the mailer behavior and not the extension.
My
bad. I had that problem too, so I fixed it in the behavior.

Sean

How is the best way to fix this then?

Cribbs wrote:

Oh, I’m sorry. You’re using the mailer behavior and not the extension.
My
bad. I had that problem too, so I fixed it in the behavior.

Sean

I mean it’s not really a major problem as such in the grand schemes of
things, but would be good to know how to change the email subject…

Oliver C. wrote:

How is the best way to fix this then?

Cribbs wrote:

Oh, I’m sorry. You’re using the mailer behavior and not the extension.
My
bad. I had that problem too, so I fixed it in the behavior.

Sean

try putting this in between your <r:mailer:form> tags…

<r:mailer:hidden name=“subject” value=“Your subject here!” />

works for me, not sure why it doesnt the other way…

Is this in development mode? Rails might be caching your yml file if
you’re working on production mode.

=] no worries…

i cant remember if i found that in a how-to somewhere, or if i figured
that one from the code itself…

Oliver,
Can you post your config part and whats in your environment.rb file.
I can’t for the life of me get the mailer behavior/extension to work
on ASmallOrange.
Specifically, what username and server are you using?
Thanks,
BJ Clark

Michael - you’re a star!

It worked a treat adding in that line of code.

I tried it before but think I just had it in the wrong place!!!

Thanks.

Michael R. wrote:

try putting this in between your <r:mailer:form> tags…

<r:mailer:hidden name=“subject” value=“Your subject here!” />

works for me, not sure why it doesnt the other way…

My environment.tb file has these lines at the VERY bottom of it, with
nothing coming after the closed bracket:

ActionMailer::Base.server_settings = {
:address => “aromatherapymassageyeovil.co.uk”,
:port => 25,
:domain => ‘aromatherapymassageyeovil.co.uk’,
:user_name => “username”,
:password => ‘password’,
:authentication => :login
}

Obviously replace the username and password with the ones that you chose
when you set up your hosting account with A Small Orange. Also,
obviously, change the domains to your one.

Next, on my Radiant admin page I have a page called contact (a child
from the home page). Its behaviour (set at the bottom) is set to Mailer.
In this page I have the following:

<r:mailer:form name=“contact”>
<r:mailer:hidden name=“subject” value=“Floral Magic Enquiry” />
Name:

<r:mailer:text name=“name” />

Message:

<r:mailer:textarea name=“message” />

<r:mailer:submit value=“Send” />
</r:mailer:form>

I created a new part for this page (by clicking the green plus icon on
the right) and named it config. In this part I have:

mailers:
contact:
subject: Contact Form
from: [email protected]
redirect_to: /contact/thank-you/
recipients:
- [email protected]

Make sure that the indents look exactly the same, and that you replace
the two email addresses with your own, and ones that ACTUALLY work. I
made this mistake and used one I hadn’t actually set up yet. You can
evne use a hotmail address if you want.

Create another part for this page in the same way. Call it email. In
this part I have the following:

*** FLORAL MAGIC ENQUIRY ***

Name: <r:mailer:get name=“name”/>

Message: <r:mailer:get name=“message”/>

Sent: <r:date />

This basically formats the email that is sent with the form data. Next,
create a new page called thank-you that is a child of the Contact page.
Just put some simple text in this page.

All being well this should work!!!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs