how to specify headers[To] in a mail?

72 Views Asked by At

I am sending a email

mail from: from_email, to: members_email_id, subject: mail_subject, :reply_to => to_email

the mail is going, but i want to customize "To", instead of users email I want to show "[email protected]" in "To".

Can we change it using headers['To']? , like " headers['Delivered-To'] = to_email " .

1

There are 1 best solutions below

0
On

What is the question here? You want to send an email to someone at members_email_id but want to show "[email protected]" in the to field?

to: is where the email will be delivered to so unless you want it sent to [email protected] it won't work.

All headers can be set as headers[field] = value or as a hash headers({'field'=>'value','field'=>'value'})