PDA

View Full Version : Stopping an email from sending if it DOESN'T have a specific word in the subject line



3yl3yl
07-02-2014, 11:14 AM
I have found a million versions of "stop it if the subject line is empty" but I'm looking for something that would stop it if it is missing something. In particular, we have client numbers, and if the email gets sent without the client number, we get in trouble. Even after five years, I've sent two just today. :doh: All of the client numbers start with 01, 02, 03, 04, or 08. I'm just looking for something that looks to be sure at least one of those numbers is in the subject line before sending. (The numbers are longer, like 02444022, etc, will that matter? They all start with one of those five though.) I'm not even worried if it only checks for 03 and I send an email with 03 but it isn't the full client number - that seems pretty unlikely. If it's easier, maybe even just looking for the zero would work?

westconn1
07-02-2014, 02:41 PM
if client number are all the same length (or use the minimum length)

try like

if msg.subject like "*0#######*" thennumber of # and 0 to length of client number


If it's easier, maybe even just looking for the zero would work?probably easier, BUT............