I am using action mailer with an array of emails. Emails are sending out successfully but in the received email, everyone can see the other recipients. I want to hide them from each other.
There are many posts about this and I've tried many things without success. Would be great if someone can spot what I'm doing wrong. I'm using rails 4.1.7. with delayed_job and devise. I am sure this must be something easy i have missed. Thanks in advance for any help.
My mailer is :
def send_email(mymodel)
@mymodel = mymodel
emails = @mymodel.followers.collect(&:email)
@url = 'http://example.com/'
mail(:to => emails, :bcc => ["[email protected]"], subject:"myemailsubject")
end
You could exchange the
bcc
value with theto
value.That should send out only 1 email, yet achieve what you want. However the email recipients might be slightly confused if they read the
to
field and don't find their own email address.You could try the following but obviously it'll send out multiple emails: