Web Connection
Apply newer SMTP properties for SendAdminEmail() and SendErrorEmail() functions
Gravatar is a globally recognized avatar based on your email address. Apply newer SMTP properties for SendAdminEmail() and SendErrorEmail() functions
  Mike McDonald
  All
  Jan 9, 2019 @ 04:33pm

Rick -

In wwProcess.prg there are functions for SendAdminEmail() and SendErrorEmail(). One forces wwSMTP.nMailMode to 0 and the other forces nMailMode to 2.

I suggest adding a nAdminMailMode property to the wwServerConfig class, and then use that property in the two wwProcess email functions, so they will pick up the value from the user's INI file.

The same scenario might also apply for the wwSMTP.nServerPort value.

Also in the default (projectname)Main.prg which is generated by the Management Console for a new project, the Process() method will optionally attempt to send an admin email for any "Unhandled Request".

That code creates a separate wwSMTP object, but doesn't set several of the more recent config properties (cAdminMailUsername, cAdminMailPassword or lAdminMailUseSSL) or the nMailMode or nServerPort wwSMTP properties. Maybe this code block could just call Server.SendAdminEmail() instead?

- Mike McDonald

Gravatar is a globally recognized avatar based on your email address. re: Apply newer SMTP properties for SendAdminEmail() and SendErrorEmail() functions
  Rick Strahl
  Mike McDonald
  Jan 9, 2019 @ 06:55pm

Well the nMailMode should be 0 - .NET is now required by Web Connection for other things, so requiring it no longer the issue that it once was so the mail mode can be set to 0 as a fixed value. Done - thanks for spotting the inconsistency.

The Mail Server Port can be specified on the mail server string like this in the INI or oServer.oConfig.cAdminMailServer:

AdminMailServer = "smtp.myserver.com:587"

+++ Rick ---

© 1996-2019