I know someone who is always present at mums and tots, PTA etc, but never present at anything she needs to actually be invited to. She's actually quite hard work, rather pessimistic, always looks stressed or flustered. She clearly wants to fit in but somehow her personality just alientates people and then she'll try too hard, which is creepy. Rule number one, don't try too hard! Definitely don't ask - that would be seriously off-putting. You can bet that the whole town will know that you put someone on the spot and embarrassed them, and then no-one will come near you at all!
Thinking about people I have known who may be in the same boat as you, I would say the following:
Don't be whiny, needy, always fed-up, or pessimistic
Don't be clingy, demanding, pushy. It freaks people out.
You say you are outwardly confident. Are you too confident? Do you hog the conversation, or brag, or lecture people?
Find new people. The old lot are clearly just not interested. Smile, and be positive. Start small. A friendly hello for a few mornings, then a brief chat, then a longer one. Move in by stealth. It might take months but don't blow it by telling someone your life story on day one and inviting them for supper on day 3. It's not normal.
Are you unusual in anyway? I'm being serious now. Eccentric? BO? Bad breath? Peculiar dress? Bizarre politics or religion? 40" bust and no bra? You don't need to be beautiful/conventional to make friends but it helps if you are at least a bit 'normal'.
ALWAYS ALWAYS ALWAYS ask people about themselves (not too nosey or personal)before you start telling them everything about you. People love to think that people are interested in them.
Try seeking out other people like yourself who always appear to be excluded. Don't just home in on anyone just because they are on their own, but really take time to analyse it. Are those people frequently on the outside of groups even though they know everyone? Ask on here if anyone is local(ish) and feels they can identify with what you say. Try to get three or four people together for coffee and see what happens. Even start a sub-group on here for people who can't make friends and maybe you could meet up. You are very brave to say what you've said, and I know there are loads of people who feel like you. Starting again with new people who all want to be liked for what they are would be a relief to lots of women.
Finally, do you contribute on here, or other boards a great deal? Do you find that your posts are well received, and you are able to communicate and gel without any problems? Do you form any bonds with other posters, shared sense of humour, etc? If not, then it is something that you are saying/attitudes and opinions that are off-putting, or maybe you are perfectly inoffensive but boring. (sorry - hard to be honest without sounding mean, no harm intended) If yes, however, then it is obviously something in your body language or appearance that is alienating others. If you APPEAR needy or weird, unapproachable, no eye contact, or invade people's body space etc, always glum, irritable or nervous you can get help from a life coach/therapist/hypnosis with all those things. Very Good luck!