How to restrict voting button to ‘To’ address and not send to ‘Cc’ in outlook via powershell?

Question:

Powershell Script[script1.ps1] -:

Php Code -:

Powershell Script is used to send email to outlook.
All these parameters username,username1 are sent from php script via shell exec command. These two are email address.

Now i want to use the voting button to approve or reject a leave which is triggered to the email addresses menetioned. I want the voting button is sent to username1 only i.e “To” addresses and not to “cc” addresses.
I want to implement this via powershell.

Answer:

Since the voting buttons (= the information on what to vote) are part of the mail, like the text and the subject, it is not possible to just make them visible to some of the recipients. Outlook (or better, the server, most likely Exchange) will send the very same email to all recipients, regardless whether they are addressed via To, Cc or Bcc.

That’s by design, as stated in RFC2822 (Internet Message Format):

The destination fields specify the recipients of the message. Each
destination field may have one or more addresses, and each of the
addresses indicate the intended recipients of the message. The only
difference between the three fields is how each is used.

You can simply send two Mails with the same content, except for the buttons:

To clear things up for the recipients, you could add a text to the mails, stating that this mail is also sent to $username.

Source:

How to restrict voting button to ‘To’ address and not send to ‘Cc’ in outlook via powershell? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply