Mailing_OnReceiveMail

The Mailing_OnReceiveMail event occurs after a message has been accepted. The mail message can be accessed using the intrinsic Mail Object.

Syntax

Sub Mailing_OnMailReceive
. . .
End Sub

Parameters
None
Example

Sub Mailing_OnReceiveMail
    '
Create a backup of the received  message
   
Dim NewMail
    Set NewMail = Mailing.CreateMail(Mail)
    NewMail.Receivers.RemoveAll
    NewMail.Receivers.Add , "backup@emilltest.com"
    NewMail.Subject = Mail.Subject & " Received on: " & Now
    Mailing.SubmitMail NewMail
    Set NewMail = Nothing
    ' Forward the original mail to the sales department
    Mail.Receivers.RemoveAll
    Mail.Receivers.Add , "sales@emilltest.com"
    Mailing.SubmitMail Mail
    Mailing.RemoveReceivedMail
End Sub

Remarks

A mailing project can listen to more than one incoming queue, mails arriving from all queues will trigger this event.

Applies To

Mailing Object

See Also

Mailing_OnAcceptMail, SubmitMail, RemoveReceivedMail



©2001-2015 eMill. All trademarks property of their owners.