The Mailing_OnReceiveMail event occurs after a message has been accepted. The mail message can be accessed using the intrinsic Mail Object.
Sub Mailing_OnMailReceive
. . .
End Sub
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
A mailing project can listen to more than one incoming queue, mails arriving from all queues will trigger this event.
Mailing_OnAcceptMail, SubmitMail, RemoveReceivedMail