0

Alright so I've got an app in which users can send 'invitations' to other users to download files. What I'd like to do is set it up so that rather than using ActionMailer I can ask users for their username/pass to their Exchange email account and then send the invitations through their account. Ideally I'd like it so that after sending an invitation through their site it will also pop up under sent emails in their account. I'm a bit unsure about how to go about this besides a rough idea of a few ajax calls and wanted to see if anybody had any experience in something similar/good ideas about how to structure this.

Thanks ahead of time!

sonobenissimo
  • 191
  • 4
  • 14

1 Answers1

0

You would still need to use ActionMailer to send the email. However, you would be routing the email to be sent from ActionMailer through the user's SMTP server.

msg = MyMailer.some_message
msg.delivery_method.settings.merge!(@user.mail_settings)
msg.deliver
Where in the above mail_settings returns some hash with appropriate keys IE

{:user_name=>username, :password=>password}

There is more information regarding this on this post. How to send emails with multiple, dynamic smtp using Actionmailer/Ruby on Rails

Community
  • 1
  • 1
kobaltz
  • 6,980
  • 1
  • 35
  • 52