Hi,
Welcome to ehealthforum,
The foul smell of vaginal discharge could indicate possibility of vaginal infection. The infection can also be one of the causes for your recent miscarriage. Visit your doctor/gynecologist at the earliest for thorough examination, vaginal swab/smear test to look for the underlying cause. Treatment as appropriate (based on examination findings and investigation results) would be started to help you control the symptoms. Avoid vaginal douching, or use of harsh soap or perfumes in the area. Use loose cotton undergarments and avoid use of tight fitting clothes. Be in regular monitoring and follow-up with your treating doctor/gynecologist and report any new/abnormal symptoms immediately. Drink plenty of water. Take adequate rest. Maintain healthy diet and lifestyle. If infective cause is detected, and if you are sexually active, get your partner also treated simultaneously to prevent chances of re-infection, and avoid having intercourse while being on treatment.
Take care.