Referal Gifting

I hope someone can help me, and this has been done before. I want to setup a page on my website which allows people who are already on my mailing list to refer another person. Then when the other person confirms I send both of them out some content. (an Ebook)

I have already got a page on my website which will capture the two email addresses, e.g.

I could put into a mailing list called “referred” and then when they confirm, the autoresponder sends them the book. But I don’t know how to get his book? Because I don’t want to send anything until his friend has been confirmed on the mailing list.

Any idea about how this might be done? I could have a separate program which emails to both of them, when a confirmed record for shows up in the mailing list. But I would prefer to do everything inside phplist if possible.

I have considered just doing everything from the website, but I would prefer to have it work through phplist.