Sends an error notification e-mail message.
Namespace:
BargeExAssembly: BargeEx (in BargeEx.dll)
Version: 3.0.400.140 (3.0.400.140)
Syntax
C# |
---|
void SendMail( string mailSubject, string mailBody ) |
Visual Basic (Declaration) |
---|
Sub SendMail ( _ mailSubject As String, _ mailBody As String _ ) |
Visual C++ |
---|
void SendMail( String^ mailSubject, String^ mailBody ) |
Parameters
- mailSubject
- Type: System..::.String
The subject line for the e-mail message.
- mailBody
- Type: System..::.String
The body of the e-mail message.
Remarks
This method is called by the BargeEx Receiver anytime an administrator
needs to be notified about an event (i.e. an error is encountered).
Any code required to send an e-mail message should be placed into
this method.
Examples
The following example, which implements the
IReceiverAdaptor.SendMail
method, sends an e-mail message via an SMTP service to the
"BargeExAdministrators@csgsolutions.com" e-mail address.
CopyVisual Basic
Public Sub SendMail( _ ByVal mailSubject As String, _ ByVal mailBody As String) Implements BargeEx.IReceiverAdaptor.SendMail Dim smtpMailClient As New System.Net.Mail.SmtpClient() ' Build a message to send. Dim msg As New System.Net.Mail.MailMessage() With msg .To.Add("BargeExAdministrators@csgsolutions.com") .Subject = mailSubject .Body = mailBody End With ' Attempt to send the email. smtpMailClient.Send(msg) End Sub
CopyC#
void BargeEx.IReceiverAdaptor.SendMail( string mailSubject, string mailBody) { System.Net.Mail.SmtpClient smtpMailClient = new System.Net.Mail.SmtpClient(); // Build a message to send. System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(); msg.To.Add("BargeExAdministrators@csgsolutions.com"); msg.Subject = mailSubject; msg.Body = mailBody; // Attempt to send the email. smtpMailClient.Send(msg); }