Hello. I am working on a script for replying to mail. What I do not know now how to do is to capture the address to which the mail was sent to? I have multiple mail accounts, and I want to be able to control events to different scenarios depending on which of my accounts / email addresses were sent to?
For example,
The spam company sends an email to first@mymail.com. Then I want the script to respond “Stop sending spam to first@minmail.com”.
If the Spam company sends instead to second@mymail.com., the mail should send a reply with the text “Stop sending spam to second@mymail.com”.
It would be best if the mail could also be sent from the respective email address, but it seems difficult?