Years ago, the standard treatment for impotence was an implantable penile prosthesis or long-term psychotherapy. Although physical causes are now more readily diagnosed and treated, individual or marital counseling is still an effective treatment for impotence when emotional factors play a role. Fortunately, other approaches are now available to treat the physical causes of impotence.
There are treatments available to help you to get and maintain an erection. In addition, making healthy changes to your lifestyle could help with impotence. Switching to a healthier balanced diet, taking more exercise and cutting down on or giving up alcohol and cigarettes could help you to see an improvement in sexual function. If you think that the problem may be related to stress or anxiety, counselling can also help.
Studies to further define vasculogenic disorders include pharmacologic duplex grey scale/color ultrasonography, pharmacologic dynamic infusion cavernosometry/ cavernosography, and pharmacologic pelvic/penile angiography. Cavernosometry, duplex ultrasonography, and angiography performed either alone or in conjunction with intracavernous pharmacologic injection of vasodilator agents rely on complete arterial and cavernosal smooth muscle relaxation to evaluate arterial and veno-occlusive function. The clinical effectiveness of these invasive studies is severely limited by several factors, including the lack of normative data, operator dependence, variable interpretation of results, and poor predictability of therapeutic outcomes of arterial and venous surgery. At the present time these studies might best be done in referral centers with specific expertise and interest in investigation of the vascular aspects of erectile dysfunction. Further clinical research is necessary to standardize methodology and interpretation, to obtain control data on normals (as stratified according to age), and to define what constitutes normality in order to assess the value of these tests in their diagnostic accuracy and in their ability to predict treatment outcome in men with erectile dysfunction.
Erectile dysfunction (ED) affects 50% of men older than 40 years,  exerting substantial effects on quality of life.  This common problem is complex and involves multiple pathways. Penile erections are produced by an integration of physiologic processes involving the central nervous, peripheral nervous, hormonal, and vascular systems. Any abnormality in these systems, whether from medication or disease, has a significant impact on the ability to develop and sustain an erection, ejaculate, and experience orgasm.
Before delving into the causes and solutions to erectile dysfunction, it’s first important to understand how erections work. The penis is mostly comprised or fibrous tissue that fills with blood upon arousal. This is what causes an erection, and after arousal is finished, blood drains back out into the body and the penis becomes flaccid. Men can have erections for no discernible reason throughout the day, but when sexual stimulation occurs, rather through contact, visual, audible, or mental stimulation, the potential for achieving an erection increases.
So what do you do? If the guilt is too much, you can tell your boyfriend. It might be the only way to clear your conscience — and hopefully, if you explain the reasons why you did such a boneheaded thing, he'll understand. It will be hard and it may create drama for months to come, but my guess is that you can recover, if he's not a horribly jealous guy.
The severity of ED has been correlated with the extent of CVD. Banks et al reported that the risk of future CV events increased progressively according to ED severity.28 This was shown in both men with and without known CVD at baseline and after controlling for confounders. Solomon and colleagues found an inverse correlation between international index of erectile function (IIEF) scores and plaque burden seen on coronary angiography.29 In addition, Yaman et al demonstrated a significant correlation between ED severity on IIEF questionnaires and coronary artery calcification.30
Acetylcholine released by the parasympathetic nerves is thought to act primarily on endothelial cells to release a second nonadrenergic-noncholinergic carrier of the signal that relaxes the trabecular smooth muscle. Nitric oxide released by the endothelial cells, and possibly also of neural origin, is currently thought to be the leading of several candidates as this nonadrenergic-noncholinergic transmitter; but this has not yet been conclusively demonstrated to the exclusion of other potentially important substances (e.g., vasoactive intestinal polypeptide). The relaxing effect of nitric oxide on the trabecular smooth muscle may be mediated through its stimulation of guanylate cyclase and the production of cyclic guanosine monophosphate (cGMP), which would then function as a second messenger in this system.
Sexual dysfunction is highly prevalent in men and women. In the MMAS, 52% of the respondents reported some degree of erectile difficulty. Complete ED, defined as (1) the total inability to obtain or maintain an erection during sexual stimulation and (2) the absence of nocturnal erections, occurred in 10% of the respondents. Mild and moderate ED occurred in 17% and 25% of responders, respectively. 
Vacuum constriction devices may be effective at generating and maintaining erections in many patients with erectile dysfunction and these appear to have a low incidence of side effects. As with intracavernosal injection therapy, there is a significant rate of patient dropout with these devices, and the reasons for this phenomenon are unclear. The devices are difficult for some patients to use, and this is especially so in those with impaired manual dexterity. Also, these devices may impair ejaculation, which can then cause some discomfort. Patients and their partners sometimes are bothered by the lack of spontaneity in sexual relations that may occur with this procedure. The patient is sometimes also bothered by the general discomfort that can occur while using these devices. Partner involvement in training with these devices may be important for successful outcome, especially in regard to establishing a mutually satisfying level of sexual activity.
Occasional successful sexual function and early morning erections do not preclude the possibility of endocrine dysfunction. Since abnormally low levels of testosterone frequently are the primary cause of impotence, it is recommended that determination of the blood level of testosterone be an integral part of the total evaluation of the impotent patient.
Endocrine evaluation consisting of a morning serum testosterone is generally indicated. Measurement of serum prolactin may be indicated. A low testosterone level merits repeat measurement together with assessment of luteinizing hormone (LH), follicle-stimulating hormone (FSH), and prolactin levels. Other tests may be helpful in excluding unrecognized systemic disease and include a complete blood count, urinalysis, creatinine, lipid profile, fasting blood sugar, and thyroid function studies.
Having erection trouble from time to time isn't necessarily a cause for concern. If erectile dysfunction is an ongoing issue, however, it can cause stress, affect your self-confidence and contribute to relationship problems. Problems getting or keeping an erection can also be a sign of an underlying health condition that needs treatment and a risk factor for heart disease.