I'm hoping to do conduct some research this summer for experience and also to strengthen my resume, however due to a few circumstances I cannot afford to be away form home for more than 2-3 weeks at a time. Some of the schools near me have professors that are conducting research in line with my interests, and a few of these schools are top 30 as well. Do these professors ever allow students who don't attend their university to work with them? If so, how does one go about contacting them?

I hope you are doing well. My name is (Insert name) and I am interested in studying/researching (area of math) under you. Currently, I am not a student at (University name) but live fairly close by. Would you be open to supervising my research?

I hope you are doing well. My name is (Insert name) and I am interested in studying/researching (area of math) under you. Currently, I am not a student at (University name) but live fairly close by. Would you be open to supervising my research?