Age 19 is the perfect physiological age for a woman to conceive a child (which mostly comes after marriage, hence why I added that). But they still wouldn't be old enough to have wisdom of the real world. 18 is the favored age of consent, since this is when both genders are reaching full maturation and now focuses on fully maturing the brain. It's agreed upon by physiologists that the brain fully matures at age 25-26, but this shouldn't have any bearing on legal marriage. It's from this age forward that I only ask those in the marriage to understand the concepts of The Real World and be prepared for it.
An 18-year-old marrying a 40-year-old is definitely risque, and it is because of the younger person's lack of knowledge of the real world that it carries risk. That person would have very little legal or financial wisdom, and it is important that both members of the relationship carry equal weight.