PDA

View Full Version : Remove certain email addresses


RichieBoy67
09-19-2017, 12:41 AM
Hello,

I have been trying to write a query to remove email addresses ending with yahoo.com in user profiles without removing the user.

Yahoo.com is blocking my emails, they are the only ones so I just want to remove the emails from user accounts so we get no more bouncebacks and to help me get those users to change the email addresses.

Thanks,
Rich

Dave
09-20-2017, 12:31 AM
The query below will set the email to an empty string where the email ends with @yahoo.com.
UPDATE user SET email = '' WHERE email like '%@yahoo.com'

RichieBoy67
09-20-2017, 10:57 AM
The query below will set the email to an empty string where the email ends with @yahoo.com.
UPDATE user SET email = '' WHERE email like '%@yahoo.com'

Thank you Dave.

I had the exact same query minus the wildcard'%' but it would not work for me. Why is the '%' needed here?

Thanks, that worked perfectly.

Just a note regarding outgoing email.. Yahoo is not like the other services. If you have a sender score of lower than 80 you are most likely out of luck in getting through to yahoo addresses. It doesn't matter if your dns is set up perfectly.

Dave
09-20-2017, 11:38 AM
If you do not include any wildcards at all, it will pretty much parse it as WHERE email = 'yahoo.com'. Wildcards simply state where in the string to look at.

RichieBoy67
09-20-2017, 12:20 PM
Thanks Dave!