October 29, 201510 yr Newbies I have a database of contacts that need to be emailed (based on find criteria) at different times of the week and *tried to create a script that would send the email through the server automatically. Unfortunately it leaves out random emails and I can't figure out why. The problem doesn't seem to be in the FIND portion. Any ideas? GO to Layout [Layout Name (Table)] If [DayofWeek (Get (CurrentDate))=2] Perform Find Sort Records Perform Script [Ticket Count Email] Else If I do this for every day of the week Monday thru Fri (I think I could use a SetVariable here to make this less cumbersome but I don't know how) The Find seems to work fine. Here is the ticket count script: Go to Record/Request/Page [First] Loop Send Mail SMTP Server settings are here and seem to be correct because the majority of emails go through. Go to Record/Request/Page [Next; Exit after Last] End Loop Any ideas. Maybe its my server just dropping them? Thanks so much!
October 30, 201510 yr A couple of things: - your "perform find" early on: you have the settings stored within that? Not a big fan of it because you can't see / read it or troubleshoot it just by setting it and seeing what it does - you don't need to loop through the records to send the email. One of the options is to send one email per found set...
October 30, 201510 yr One of the first things to do is to log the result from Send Mail with Get(LastError) for each contact you send. Then if that turns up nothing, you'd have to dig into the logs of your email server (the SMTP relay that your FMS uses). The sorting of records seems pointless?
October 30, 201510 yr Author Newbies A couple of things: - your "perform find" early on: you have the settings stored within that? Not a big fan of it because you can't see / read it or troubleshoot it just by setting it and seeing what it does - you don't need to loop through the records to send the email. One of the options is to send one email per found set... Here is the Find: Find Records Dates::Date: [>=//] AND Dates::T Count Date: [=Thurs] Omit Records Dates::On Sale [.//] Omit Records Dates::Itin Topsheet: [=F] OMit Records T COunt Day: [=Auto] OMit Records Dates::TIcket Count Start Date: [>//] ITs my understanding that when you send one email per found set, the script won't send if there is an error in any of the emails so I wanted to avoid that. One of the first things to do is to log the result from Send Mail with Get(LastError) for each contact you send. Then if that turns up nothing, you'd have to dig into the logs of your email server (the SMTP relay that your FMS uses). The sorting of records seems pointless? I Have never used this function. Where do I place it within the loop? Will the other emails get sent if there is an error in one of the records or will it stop the whole script from that point?
October 30, 201510 yr One issue with the loop is that you may have to insert a pause every say 50 or 100 iterations otherwise you may be overloading your SMTP server with multiple email requests per second...
October 30, 201510 yr Author Newbies interesting. I hadn't thought of that. I will see how to do that and see if it helps. Thanks!
Create an account or sign in to comment