I have a scheduled script that sends an email. I'm...
# general
c
I have a scheduled script that sends an email. I'm testing it in sandbox. Checking the sent email list, all of the emails status' are "Not Sent". Our email settings are set to send to currently logged in user. I changed it to send all sandbox emails to me and it's still not working. Is there a trick to this?
m
@Corey Schwoebel Double check you code for the email portion. I've had it several times where it attempts to send, but fails, without throwing an error. Are you attaching any files/PDFs to the email?
c
Nothing crazy, just text. Email sends when running the code in browser console
m
Is the email log showing the proper email addresses for the attempted sending? A weird quirk I have come across. Sometimes when using a customer/employee/entity ID through a variable to set the author or recipient, I've had to specifically parseInt() or do some type of forced number coercion to get it to pick up properly.
Oh, and how many people are you trying to email at one time?
c
Everything looks correct. Only red flag is this
Just one recipient
m
Only other thing I can think of, is in the past if I run several tests in a row, I'll suddenly have emails stop sending. I give it some time before attempting an email again and it will start working just fine. Almost like there is an internal governance or hang-up in the email process in the sandbox.
c
That's kind of what i'm thinking at this point - I'm going to give it some time and try again.
Thanks @Matt Carter!
c
@Corey Schwoebel I dont think sandbox can actually send emails?
c
Maybe by default, but it definitely can
f
How you created an email subject? Email subject should be unique (e.g. including transaction number in the subject). Else it wil be recognised as a spam and won't be sent out