wwProcess::SendErrorEmail

This method sends email to the assigned administrator that is configured in the Web Connection configuration in app.ini. Specifically it uses the various AdminEmail* values in the configuration to configure mail server, authentication and sender information. Emails are sent only if Adminsenderroremail=On.

This method is called internally for hard errors that occur in the default wwProcess::Error() handler. You can use the llForce parameter to explicitly force a message to be sent independent of that configuration flag which is useful for explicit emails.

Meant for Admin Emails Only

You shouldn't use this method to send application level notifications to end users as this method uses Administrator sender information which is likely not the same account you'd be sending things like authentication, verification and confirmation messages. For those scenarios use wwSmtp directly or add a custom email method to your own Process or business classes.

Messages are Sent Async

The messages that are sent are sent asynchronously and there's no error checking on failures. So, please ensure that you check your email settings by either triggering an error with AdminSendErrorEmail=on or create an explicit method that sends a test message in your server to verify your emails are working and getting sent.

o.SendErrorEmail(lcSubject, lcMessage, lcRecipient, lcSender, llForce)

Parameters

lcSubject
The header of the email. This header should have an easily identifiable text so you can flag and possibly sort this message into an error mail box for easy retrieval of problems on your server.

lcMessage
The body of the message. This body is appended with information about the request itself including the URL that ran the server that got hit, the client's IP address and browser.

lcRecipient
Optional - The email address of the person that is to receive the email. If not specified it defaults to the WWC_ADMINISTRATOR_EMAIL setting in wconnect.h.

lcSender
Optional - The email address of the person that's sending the message. If not specified it defaults to the WWC_ADMINISTRATOR_EMAIL setting in wconnect.h.

llForce
Optional - if .T.?always forces the email to be sent, even if the lSendAdminEmail flag in the configuration is set to .F. which usually won't send emails. This is meant as an override to use to send explicit admin emails that are not internal to Web Connection. Note: For more control it's recommended you use wwSmtp directly to send emails and use an application specific send routine that uses your non-admin credentials and contact info to send emails.


See also:

Class wwProcess | wwipstuff::sendmail | wwipstuff::sendmailasync

© West Wind Technologies, 1996-2024 • Updated: 10/27/21
Comment or report problem with topic