Origin: "Here's mud in your eye" has, over the years, become something of a generic toast, along the lines of "cheers" or "bottoms up," but while the toast may be well known, the origin, and indeed the meaning, of this particular glass-clinking salutation is as clear as, well, mud.
Most toasts with the toastees a long, healthy life, and good fortune, and most commonly made at weddings and other formal occasions. It is commonly believed that the practice of clinking glasses together was invented to insure that ones drink had not been poisoned. (To ensure there was no poisoning, drinkers would pour a little of their drink into the other person's drink, but if there was mutual trust between both drinkers, the glasses were clinked to communicate this trust.)
This origin is almost certainly false: it's more likely that clinking glasses is just a way of making a physical connection as a way of acknowledging the spirit of the toast. But while toasts generally offer well-wishes or positive sentiments, there is a tradition of bawdy and sometimes insulting toasts as well.
There are several explanations generally given for the origin of the "mud in your eye" toast, the most unsatisfying of which is that it originated with soldiers during World War I who had engaged in muddy trench warfare. This one seems like a bit of a stretch.
Another story suggests that the toast is an insulting one, and it refers to horse races, in which the losing horses (and their jockeys) would get splattered with mud. Only the winner would remain unsplattered.
A more convincing possible origin is the New Testament of the Bible, specifically John 9:1-9:41. This passage relates the tale of Jesus restoring sight to Celidonius, a man born blind, by putting mud in the man's eyes and instructing him to wash himself in the Pool of Siloam. This story makes sense in terms of offering a well-wishing toast, but there is no evidence directly linking this Biblical passage to this particular toast, so the mystery remains.
http://www.web2carz.com/trends/offline/1864/dont-be-an-idiom-heres-mud-in-your-eye