' Outbound Mail Server ' This script fires before emails are sent via the Email2DB Mail Server. ' Use it to implement custom accept/reject rules, or change/add headers or message text. ' Set the property Email2DBAccept to True to accept the message. ' The current message can be accessed via the MSG object. Sub Main() ' commands start here Email2DBAccept = Email2DBAccept Dim numto As Long numto = MSG.NumTo If (numto > 0) Then For i = 0 To numto - 1 'This checks to see if the email exists in the DB if it does then it does not relay it. 'If it does not exists then it sends it normal and allows it to relay out. If MSG.GetToAddr(i) ="email@example.com" Then Email2DBAccept =False Else Email2DBAccept=True End If Next ' This is the final end if below which has the starting of the If (numto) in the begining End If End Sub
From novice to tech pro — start learning today.