Raises when recipients email address gets refused by the smtp server.
[Visual Basic]
Public Event AddressRefused() As RefusedRecipientEventHandler[C#]
public event RefusedRecipientEventHandler AddressRefused();The event handler receives an argument of type RefusedRecipientEventArgs containing data related to this event. The following RefusedRecipientEventArgs properties provide information specific to this event.
| Property | Description |
|---|---|
| Address | Gets the reference for refused Address. |
| Message | Gets the reference of the Message where the event occurs. |
| SmtpResponse | Gets the reference of type SmtpResponse. |
This event is raised for each of the recipient(s) address specified in To or Cc or Bcc that gets refused by the server. For setting up events for individual recipient list, refer AddressRefused. Inorder to block message from sending if any of the recipient get refused by the server, refer AllowRefusedRecipients.
The following example demonstrates how to make use of AddressRefused Event when recipients address get rejected by the server.
[Visual Basic]
Imports ceTe.FireMail
Module MyModule
Sub Main()
' Create a PlainTextMessage
Dim MyMessage As PlainTextMessage = New PlainTextMessage("Full Name", "from@company.com")
' Create Handler for AddressRefused Event
AddHandler MyMessage.AddressRefused, AddressOf All_AddressRefused
' Add one valid address and one invalid address
MyMessage.To.Add("to@company.com")
MyMessage.To.Add("invalidaddress@company.com")
' Test by sending this message
MyMessage.Send("localhost")
End Sub
Private Sub All_AddressRefused(ByVal sender As Object, ByVal e As RefusedRecipientEventArgs)
' Print the refused email address
Console.WriteLine(e.Address.EMail & " is Invalid")
End Sub
End Module
[C#]
using ceTe.FireMail; |
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Message Class | Message Members
© Copyright 2006, ceTe Software