Yes, if you can get the calories and extra proteins from a vegetarian diet that will work.
The key is to add enough extra calories every day, and in those calories you need to make sure that there is enough extra proteins.
I'm sorry I didn't mean to say meat is necessary, I just mentioned that as a counter argument to emphasize practicality to get the goal done, that's all. For example it may seem silly, but if you don't have a car and you're going to be serious with this, you're going to be very hungry, and that means doing groceries more often, and carrying more food. I had to lug loads of milk cartons, bananas and stuff. Vegetables can take lots of space for comparatively less calories.
So to replace meat you'll probably want to go for peas and lentils. Standard vegetables in non vegetarian diet, like salad, tomatoes, broccolis etc. all have very healthy stuff in it like vitamins and iron, but they really suck when it comes to calories. Same goes for fruits. The most affordable to me then was bananas. Anything else was for pleasure and not gaining weight.
Actually I love milk and I drank lots of full fat milk, ate loads of bananas, loads of pasta and rice, gouda cheese (easiest to buy in packs), etc. Lots of tuna cans too. And lots of crap food like durums or crisps now and then and coca cola when I was out with friends, to reach the daily target. I didn't have to worry about those as I was going to burn through them anyway. All that matters is to make sure the daily amount of quality proteins is reached, and split it throughout the day.
Ok, so I found notes from 2003. I had like a weekly log with 7 columns per A4 page where I noted everything I ate. At the beginning it seems I was going for 85+ g of proteins per day. Just try and see how you can get 80 g of decent proteins per day and then maybe you'll understand why I was trying to simplify, including ditching the vegetarian only approach
if necessary. I love to simplify things to focus on my goal, you may be able to do the same without simplifying as much as I do.
Whey powder may not be bad at all. If you buy simple whey powder, perhaps with vanilla or chocolate for taste, that stuff's pretty basic. It's not really unhealthy. To be honest I was so self conscious back then I was too afraid to buy powder at the gym