Something similar happened to me about 30 years ago in the UK. I would suggest setting up a face-to-face meeting with your supervisor. When I did this, email wasn't much of a thing: I think I just caught her in the corridor and asked something like "Can we meet to discuss my research project?".
I graduated with a good BSc. in Microcomputer and Electronic Engineering and went on to become a Research Student1 at the same institution working towards an MSc. and then a PhD. The work started well – interesting, challenging-but-achievable – but after a while it was becoming clear that the work was heading in a direction that I was not as interested in, nor as capable at. After about a year – after a certain amount of anguish – I realised that things were unlikely to work out – at least in their current form – and plucked up the courage to confront my supervisor.
Yes, I must have had some feelings of shame and failure, but I had also convinced myself that it was in neither of our interests (me or the department) to continue for another two or three years not really making progress and with little or nothing to show at the end of it.
Obviously there was some disappointment on my supervisor's part that I felt unable to continue (both for me, and for the department), but there was never any animosity. Like me, I think she was glad that I brought it up sooner rather than later (didn't waste as much of her or the department's time, potentially allowed the funding behind my work to be used for someone else).
And far from "never get[ting] a reference from them" we discussed what I was interested in, and I was offered (and took) the chance to become a Research Assistant2 on a new three-year project (later extended to four years) that was due to start shortly. The only "concession" they asked was that I "went through the motions" of submitting for an MSc. (knowing I wouldn't get one) as this helped the "box ticking"...
1 In the UK at the time you were first a normal (undergraduate) student studying for a first degree (BA/BSc). Then some would become a Research Student (usually funded) with the primary purpose to get either a Masters (MA/MSc) and/or a doctorate (PhD).
2 A Research Assistant positions was effectively an employee of the university, working on a specific research project. The primary goal was doing the research (which often tended to be more about the application of ideas), but opportunities for higher degrees were still present.