Mesh to boundary curve (opening included)

Try aligning and welding the vertices first, see this topic: