Article 13 prohibits the use of email addresses for marketing purposes. The Directive establishes the opt-in regime, where unsolicited emails may be sent only with prior agreement of the recipient. A natural or legal person who initially collects address data in the context of the sale or a product or service, has the right to use it for commercial purposes provided the customers have a prior opportunity to reject such communication, either where it was initially collected or subsequently. Member States have the obligation to ensure that unsolicited communication will be prohibited, except in circumstances given in Article 13.
This BBC article claims that an European Union directive will make spam illegal in the EU from October on (Slashdot discussion).
That is somewhat misleading. Directives are addressed to the Member States. They have to adjust their legislation to transpose the directive. As long as that doesn't happen, there is no legal effect. The October date is the deadline for completing the Member State legislation. It does not mean the directive will have any direct effect.
Actually there are two relevant directives: