Smoking cessation, both pre- and postoperatively, is important to reduce complications associated with surgery. Identifying feasible and effective means of alerting the patient before surgery to the importance of perioperative smoking cessation is a challenge to healthcare systems. A randomized registry-based trial using the web-version of the Swedish national quality register for gynecological surgery, GynOp, was performed (ClinicalTrials.gov NCT03942146). Current smokers scheduled for gynecological surgery were randomly assigned before surgery to group 1 (control group, no specific information), group 2 (web-based written information), group 3 (information to doctor that the woman was a smoker and should be recommended smoking cessation or group 4 (a combination of groups 2 and 3). Perioperative smoking habits were evaluated in a postoperative questionnaire 2 months after surgery. The treatment effect was estimated to be a 15% reduction in the number of smokers at the time of surgery. Thus, 94 women in each group were required, in total 376 women, using a one-sided test with an alpha level of 0.001 and a statistical power of 80%. Participants (n = 1427) were recruited between 5 November 2015 and 6 December 2017. A total of 1137 smokers responded to the follow-up questionnaire (80%), with 486 women declining to participate, leaving 651 women eligible for analysis. Women who received both web-based information prior to surgery and information from a doctor, reported smoking cessation more often from 1 to 3 weeks preoperatively (Odds ratio [OR] 1.8, 95% confidence interval [CI] 1.0-3.3) and 1 to 3 weeks after surgery (OR 1.9, 95% CI 1.1-3.3) compared with the control group who received no specific information. A combination of written information in the health declaration and a recommendation from a doctor regarding smoking cessation may be associated with higher odds of smoking cessation at 1-3 weeks pre- and postoperatively.