How can I send e-mails with the BCC header? I follow the ruby on rails guide and set :bcc => "[email protected]"
and it doesn't work.
Thanks
edit by corroded Here's the code I tried:
def booking_confirmed_email(booking) @booking = booking mail(:to => booking.contact_email, :bcc => "[email protected]", :subject => "Congratulations, #{booking.contact_name}!") end
also tried:
def booking_confirmed_email(booking) @booking = booking mail(:to => booking.contact_email, :bcc => ["[email protected]"], :subject => "Congratulations, #{booking.contact_name}!") end
to no avail
Full details here:
http://api.rubyonrails.org/classes/ActionMailer/Base.html
Short answer:
mail(:to => "[email protected]" , :subject => "Example Subject", :bcc => ["[email protected]", "Order Watcher <[email protected]>"] , :cc => "[email protected]" )
note how you can pass an array of email addresses to each of the :to, :cc, :bcc options.
RailsCast:
http://railscasts.com/episodes/206-action-mailer-in-rails-3
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With