Forum: Ruby on Rails Issue with using Net::SMTP bcc-ing or cc-ing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fd53133630b6a9e8097b7c74f8d53201?d=identicon&s=25 railerbaby (Guest)
on 2009-03-15 14:49
(Received via mailing list)
Hi all,

I'm a little bit confused with things ... hope someone can help me
out.

I'm trying to do something very simple.

1. Create an email using Tmail
2. Then put cc, bcc
3. Send out using Net::SMTP

Problem is that it is not Cc-ing or Bcc-ing at all. Can someone look
at this and let me know what's happening
I'm running this from the command line via script/runner

require 'tmail'
require 'net/smtp'

mail = TMail::Mail.new
mail.cc = ['myccaddress@gmail.com']
mail.to = ['mytoaddress@gmail.com']
mail.subject = "Hey"
mail.body = "Somehow this is not cc-ing at all!!"
Net::SMTP.start('mail.mydomainname.com', 25) do |smtp|
  smtp.send_mail(mail.to_s,
'from@myfromaddress.com',mytoddress@xxx.com')
end
This topic is locked and can not be replied to.