If you deposit 999 Pokemon in My Pokemon Ranch, Hayley (the person who takes care of the Pokemon you deposit) will trade you a Mew if you trade a Pokemon Egg to her. However, the only way to get My Pokemon Ranch is through the wii shop that is not available anymore, so if you don't have it you can't get it.
This is true, but there are other ways to get one in Diamond and Pearl.
In Pokemon Emerald and FRLG, there was an event where you could go and catch a Mew. This is also the only way to get a Shiny Mew. However, like Pokemon Ranch, this event is unobtainable anymore, so unless for some reason you still have it, you cannot get it.
Now to the DNS server glitch. This is a very popular exploit used today to access events from the Gen 4 and 5 games. All it involves is changing the Dns on your Nintendo 3DS, and going to Mystery Gift on these games. This website should tell you all you need to know. However, you probably need to buy something extra to get a Mew. Using the DNS server glitch, you can access a Level 5 Mew in any copy of HGSS. From there you can trade it to Diamond/Pearl. But, if you have a Japanese copy of Diamond/Pearl, you can get a Lvl 50 Mew using this server glitch.
However, the Gen 4 DNs sever glitch is very... Impersistent. You need an older wifi router to access these. For me, accessing the Gen 4 events would not work. There are many guides on the internet to help you.
These are the only ways to access a Mew in Gen 4 without hacking. Hope I could help!