I am using ActionMailer for my Rails 2.3.9 application.
When I send an email using:
deliver_user_invite
configurations:
def user_invite(subject, content)
subject subject
from "User Invite <invite@mydomain.com>"
recipients "invites@mydomain.com"
sent_on Time.now
content_type "text/html"
body :content => content
end
with SMTP configuration
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'mydomain.com',
:authentication => :plain,
:user_name => 'user@mydomain.com',
:password => 'password'
}
However, when sending an e-mail, the sender displays as user@mydomain.com , not invite@mydomain.com.
Can I have a different SMTP configuration for different email addresses? or Is there a way to set the sender address from the ActionMailer configuration?
source
share