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!

4

1 回答 1

0

您仍然需要使用 ActionMailer 来发送电子邮件。但是,您将通过用户的 SMTP 服务器路由要从 ActionMailer 发送的电子邮件。

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}

在这篇文章中有更多关于此的信息。如何使用 Actionmailer/Ruby on Rails 发送具有多个动态 smtp 的电子邮件

于 2013-10-03T19:27:21.410 回答