+
+ else begin
+ if Cmdline.IsPresent('USERMODE') then begin
+ Out.writeln('Starting MgSMTP in user mode...');
+ SetConsoleCtrlHandler(ConsoleCtrlHandler, true);
+ Service(0, nil);
+ end
+ else begin
+ Out.writeln('Trying to contact Service Control Manager...');
+ Out.writeln('(If you see this message on console, you tried to');
+ Out.writeln('start up the program incorrectly. Your current');
+ Out.writeln('attempt will fail, or it may hang under Wine.)');
+ Out.writeln;
+ ServiceMode:= true;
+ if not StartServiceCtrlDispatcher(ServiceTable) then begin
+ ServiceMode:= false;
+ Out.writeln('Failed!');
+ Out.writeln;
+ Out.writeln('You need to start MgSMTP as a service,');
+ Out.writeln('or supply proper arguments!');
+ Out.writeln('Issue with /? for more information.');
+ end;
+ end;
+ end
+