# ActionMailer

**URL:** <https://www.ruby-forum.com/t/actionmailer/64620>\
**Category:** Rails\
**Created:** [August 15, 2006, 1:57pm UTC](https://www.ruby-forum.com/t/actionmailer/64620 "2006-08-15T13:57:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnnybutler7](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/8491ac/32.png) [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Post date:** [August 15, 2006, 1:57pm UTC](https://www.ruby-forum.com/t/actionmailer/64620/1 "2006-08-15T13:57:33Z")

</div>

Im trying to send an email see the code below:

Model: order\_mailer.rb  
class OrderMailer \< ActionMailer::Base  
def send\_an\_email()  
@recipients = “removed\_email\_address@domain.invalid”  
@from = “removed\_email\_address@domain.invalid”  
@subject = “Ruby Test”  
@body = “The Body”

end  
end

View: send\_an\_email.rhtml

Email was sent!.

Controller: Admin.rb  
def sendmail  
OrderMailer::deliver\_send\_an\_email() # notice the ‘deliver\_’ prefix  
end

environment.rb  
ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.server\_settings = {  
:address =\> “[auth.smtp.1and1.co.uk](http://auth.smtp.1and1.co.uk)”,  
:port =\> 25,  
:user\_name =\> “myusername”,  
:password =\> “mypassword”,  
: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” # default:  
“text/plain”  
ActionMailer::Base.default\_mime\_version = “1.0”  
ActionMailer::Base.default\_implicit\_parts\_order = [ “text/html”,  
“text/plain”]

This code isnt working as no emails are beint sent or received. Can  
anyone help me? How can debug whats happening to try and give me a clue  
as no error messages are showing up.
