How to professionally deal with sexual harassment in academia
While you seem confident that the individual's behavior is unprofessional, other people in your situation might not be as confident. If you have any doubt about if someones behavior is unprofessional, find a trusted colleague and ask them in confidence.
Once you are confident that the behavior is unprofessional, the next time he emails you, send him an email that clearly states that his behavior is unprofessional and that you feel sexually harassed. Then tell him that while you have endured it in the past, that it must stop and if necessary you will report the behavior to your supervisor, his supervisor, and any other relevant offices at your and his institutions. Finally, close with saying that you hope the behavior will stop and that this can all just be water under the bridge and that you can continue to have a professional collaboration. If you have any doubts, show the email (you can write it now), to a trusted colleague and get feedback.
If, after sending the email, the behavior does not stop (or he argues), you tell your supervisor. You can either work with the supervisor to bring the fury that is the university HR department when faced with issues of sexual harassment or a gentler back channel process. The choice is yours and anyone that would hold that choice against you is not someone you need to form collaborations with.
You want to start documenting things. This means saving the harassing emails. You also want to email him so you have a copy of what was said. Do not tell him in person (both because he doesn't deserve that type of interaction and because it gives you a record of what was said). If/when you talk to colleagues for advice or to your supervisor, do that in person or on the phone. You don't want them to feel like they are being watched. If your supervisor does not react as you hope, then follow up in writing.
I assume you are worried about possible future retaliation or other future actions.
I suggest that you don't try to handle this on your own. You need someone who you trust and who is superior to both of you in the profession to be made aware of the situation. There should be some sort of record of what has happened, with the record known to the "superior".
That person can be your supervisor or not, as you choose, but the supervisor would normally be a good person, other things being equal. It shouldn't in any just world reflect badly on you.
But having the record and a neutral third party protects you from most future problems. An alternative to a superior is just a fairly wide group of people who are kept informed and who will speak for you if the other person starts do do more "aggressive" or unprofessional things.
Whether you inform the "harasser" or not is up to you and would depend on personalities, but it might not be a bad thing to drop the hint that you've discussed these unwanted emails with X.