Announcement

Collapse
No announcement yet.

help with an exchange script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • help with an exchange script

    Hey all, I come to you looking for some more help The previous network administrator had written a script to send out emails whenever a payment was received at one of our district offices. The problem we're running into here is that we're receiving duplicate emails for the same payment being received. The script is pretty clean and we have looked over it a few times so i'm not too sure what the problem could be but maybe it's on the tip of my nose, any and all help is greatly appreciated.

    -Matt

    Script:

    <SCRIPT LANGUAGE="VBScript">

    'Event will fire at the onsave event for the speedpay mailbox.
    Sub ExStoreEvents_OnSave(pEventInfo, bstrURLItem, IFlags)

    'Declare Variables
    Dim MsgCur
    Dim MsgFwd
    Dim Subj

    'Create CDO object and assign incoming message to the object.
    set MsgCur = CreateObject("CDO.Message")
    MsgCur.DataSource.Open bstrURLItem
    Subj = MsgCur.subject

    'Case statement to forward message to appropriate district according to subject content.
    Select Case Subj
    Case "PAYMENT RECEIVED + SDO"
    set MsgFwd = MsgCur.forward
    MsgFwd.to = "[email protected]"
    MsgFwd.from = "[email protected]"
    MsgFwd.send
    set MsgFwd = nothing
    Case "PAYMENT RECEIVED + IDO"
    set MsgFwd = MsgCur.forward
    MsgFwd.to = "[email protected]"
    MsgFwd.from = "[email protected]"
    MsgFwd.send
    set MsgFwd = nothing
    Case "PAYMENT RECEIVED + ODO"
    set MsgFwd = MsgCur.forward
    MsgFwd.to = "[email protected]"
    MsgFwd.from = "[email protected]"
    MsgFwd.send
    set MsgFwd = nothing
    Case "PAYMENT RECEIVED + RBL"
    set MsgFwd = MsgCur.forward
    MsgFwd.to = "[email protected]"
    MsgFwd.from = "[email protected]"
    MsgFwd.send
    set MsgFwd = nothing
    Case "PAYMENT RECEIVED + CSR"
    set MsgFwd = MsgCur.forward
    MsgFwd.to = "[email protected]"
    MsgFwd.from = "[email protected]"
    MsgFwd.send
    set MsgFwd = nothing
    Case "PAYMENT RECEIVED + EDO"
    set MsgFwd = MsgCur.forward
    MsgFwd.to = "[email protected]"
    MsgFwd.from = "[email protected]"
    MsgFwd.send
    set MsgFwd = nothing
    Case "PAYMENT RECEIVED + GDO"
    set MsgFwd = MsgCur.forward
    MsgFwd.to = "[email protected]"
    MsgFwd.from = "[email protected]"
    MsgFwd.send
    set MsgFwd = nothing
    End Select

    'Delete remaining objects.
    set MsgCur = nothing

    End Sub

    </SCRIPT>

  • #2
    Re: help with an exchange script

    are both email addresses getting duplicates? Either way, perhaps one or both is set to forward those emails (when from the automated program's email address) to the other email address, hence creating duplicates?
    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment

    Working...
    X