Ruby Net::SMTP - Send email with bcc: recipients

后端 未结 2 440
半阙折子戏
半阙折子戏 2021-02-06 09:05

I would like to use Ruby Net::SMTP to send email. The routine

send_message( msgstr, from_addr, *to_addrs )

works well in my code for sending em

2条回答
  •  面向向阳花
    2021-02-06 09:35

    The to_addrs parameter of send_message specifies the envelope to addresses. Including an address in to_addrs has no effect on the to and cc addresses that get included in the message header.

    To bcc a recipient, include the address in the to_addrs parameter, but don't include it in the headers in msgstr. For example:

    msgstr = <

    This will send an email to three recipients: to@example.org, cc@example.org and bcc@example.org. Only to@example.org and cc@example.org will be visible in the received message.

提交回复
热议问题