In the episode The Sign of Three (S03E02), Sherlock remembers that Tessa knew John's middlename and this is how he figures out the whole thing about the Mayfly Man and his attempt to assassinate one of the guests.
I didn't really understand the connection between him dating the women and attending the wedding. I mean, he was the photographer, so he did not need a date for the wedding. And if Tessa was not invited, but only saw the photographer's invitation, why would the killer need to date those women?
So, what was the purpose of dating the various women?