I just read another question about dominant chords and in reading the answers this question came to mind for me. Can a V chord still be considered dominant if the seventh in that chord is not flatted?
The dominant chord, diatonically, is based on the 5th note. So for its triad, it will include the 5,7 and 9. In C, those notes would be G,B and D. The B is the leading note of C, which gives its dominant feel, trying to return to root C.
Going to the next note in the chord series, F, produces a tritone (B>F) which unstabilises the sound. It's dissonant. It also has that same one semitone move to get back to the maj3 of C, which is F>E.
By making the V into a maj7 chord, a non diatonic note (F#) would need to replace the F. F is diatonic in the present key (C), but F# would be the leading note in key G, which is not the present key. Without the tritone, which begs for resolution, Vmaj7 is weak, so weak it doesn't push. Therefore it's not dominant.
The V alone is a considered a dominant chord. The reason for this even without the extra tension of the major 3rd/minor 7th interval is the 3rd of the chord is the leading tone. The leading tone is the bread and butter of tonal harmony so much so that minor harmony makes use of it even not being in the scale "naturally".
If you were to use the major 7th instead the tension from the leading tone would still be there, but the resolution definitely wouldn't be as strong. The major 7th of that chord would be the tritone in relation to the root of I. Going down to the 3rd of I is the typical desire of the 7th in a dominant chord, but would be awkward jumping from the tritone by more than 1 semiton. Going up to the 5th might be more desired, but 7ths in general like to resolve downward so the resolution may not sound as expected.
Although the Ⅴmaj7 can't be as forcing a dominant as Ⅴ7, it can still be used as dominant-ish. Crucial is that the maj7 wants to resolve upwards, not downwards (which brings us to the Ⅴ of Ⅰ).
Now, the other notes in the chord (save for the fundamental) also want to resolve upwards, so you end up with a very parallel voice-leading situation. Common-practice generally frowns upon this, but it's always the question what effect you aim for. And it so happens that this kind of dull, hard-synchronised movement works excellent as a ticking-clock effect. As such it was used by Gustav Holst in the Planets. The upper voices are mostly just moving around block chords in this parallel motion, but (unlike in the Mars movement) Holst keeps them in the tonality – the signature of the movement is am, but the passage is clearly in cm:
X:1 T:Saturn, the Bringer of Old Age L:1/4 M:C K:Am %%score T B V:T clef=treble V:B clef=bass % 1 [V:T] [_EGc]2 [D^FB]2 | [_EGc]2 [^FAd]2 | [G_B_e][G_Bd] [F_Ac]2 | [^FAd]2 [D^FB]2 | [_EGc]2 [V:B] z C, z G,, | z C, z _B,, | z _E, z F, | z D, z G, | C,2
Notice in particular the cadence Ⅱ - Ⅴmaj7 - Ⅰ at the end.
The chances are that if you're looking at a piece of music where Vmaj7 pops up, it's actually not functioning as dominant harmony. It could be modal, or it could be that there's been a modulation, or it could be that the chord is just being used for color and is not functioning as a dominant.
Also keep in mind that the interval between the 3 and 7 in the dominant 7 chord is a tritone, and it's the instability and tension of this interval that makes it wish to resolve itself by a semitone in each direction.