Sonnet 18 is a complex sonnet and, at one level, it is as described in the answer above. The tone of its opening quatrain is, indeed, optimistic but, equally frustrated by the constraints of the sonnet tradition and its use of stock comparisons, to express a love which the lover seems to surpass. Thus, in the opening two lines, ('Shall I compare thee to a summer's day?/Thou art more lovely and more temperate') The mood is as much frustrated at the inability of nature to match the delight of the lover as it is optimistic.
However, the tone of the poem is, for all of its delight in the wonder of the lover, also suffused with irony in so much as it is also a demonstration in the problems of writing about love and about the power of the written word. Much as the opening Octave is all about the lack of suitable comparisons to truly express the beauty of the beloved, the end of the poem is very different. For all of the seeming changeability and transience of natural beauty, the poet in the sestet claims that death will not 'brag' that the lover 'wander'st in his shade' because the poet has captured this ethereal beauty in the 'eternal lines' of his poem. This poems is doubly ironic in this sense: at one level, the poet has just spent a good deal of time complaining of the inability of language to express the beauty of the beloved only now to claim that he has trapped them in 'eternal lines'; at another level the irony of the poem might be that the poet is as enamoured of the creature that he has conjured in his own mind, the overly romantic image of the beloved that he has trapped in these 'eternal lines' as he is in the lover who, of course, will fade away just like 'a summer's day'. Thus, while the poem might be read as sincere in tone, it is also undercut by self-consciousness and irony.