I'm trying to do automate stuff with PHP and IMAP.
I assign a key to every elements I have in my database (e.g. issue tickets) so people can send mails with attachments to myaccount+key@mycompany.com
. With PHP and IMAP I get the "key" and then assign the body and attachment with the element which has the "key" assigned.
This works wells except when some people wants to redirect automatically a generic e-mail account to the assigned e-mail address.
So, for instance, I have:
Original sender: user1@example.com
Generic e-mail address: issues@alpha.com
Assigned key: 123456
They configure to redirect issues@alpha.com
to myaccount+123456@mycompany.com
When I examine myaccount@mycompany.com
and get the mail, with PHP and IMAP I get the sender, but is issues@alpha.com
and I want to get myaccount+123456@mycompany.com
in order to determine where I must put the information.
I try all with PHP IMAP functions but I get nothing although reading the original mail from gmail, I show a "Delivered-To"
field where is stored the myaccount+123456@mycompany.com
.
How can I get the delivered-to field?
Thanks a lot.
Regards!