Skip to content
Advertisement

Getting invalid mail error during phpmailer bulk mail sending [closed]

php mailer is mass mail, but if a mail address in a record is incorrect, it stops sending mail. How can I skip that address and continue.

I RETURN ALL MY CODES FROM MY DATABASE TO LIST WITH FOREACH HERE I didn’t have a problem when I tried my codes on a array of two different emails of mine

JavaScript

Advertisement

Answer

You could check if the email address is valid, and if the mailserver will respond, before using $mail->addBCC(). This function can do both:

JavaScript

I didn’t update the style of this function. It is not perfect, but using something like this will make your mass mailer work a lot better. Your code would look something like this:

JavaScript

You could add an else part to notify yourself of the invalid email addresses.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement