Giter VIP home page Giter VIP logo

Comments (7)

zkingdesign avatar zkingdesign commented on July 30, 2024

@bilalmalkoc having the same issue, did you manage to figure out a solution to this?

from wp_mail.

bilalmalkoc avatar bilalmalkoc commented on July 30, 2024

@zkingdesign no i can't

from wp_mail.

zkingdesign avatar zkingdesign commented on July 30, 2024

@bilalmalkoc , what I did is that I've put the code into a foreach, and looped through it.

foreach ($emails as $email) {
            $item = WP_Mail::init()
                            ->headers("<". get_option('admin_email') .">")
                            ->to($email)
                            ->subject('Update')
                            ->send();
        }

from wp_mail.

bilalmalkoc avatar bilalmalkoc commented on July 30, 2024

@zkingdesign it can gives timeout error when you try for 1000+ emails.

from wp_mail.

r-nicol avatar r-nicol commented on July 30, 2024

@bilalmalkoc from what you have described there is no actual issue with the code. In fact it's working just how it should. If you want to send the same email to multiple people, but hide who you sent that to, you have to use BCC (Blind Carbon Copy) not To or CC (Carbon Copy). That way each recipient get their own copy of the email. Also if you are trying to send to 1000+ people at once you should probably be doing that in a cron or queued job outside of WP. That way you avoid your web server (Apache/Nginx etc) Timing out the request.
@anthonybudd This is not a bug and should be closed.

from wp_mail.

mukeshwani avatar mukeshwani commented on July 30, 2024

Hello,
Trying to pass an Array to the TO field, I'm getting two PHP warnings:
PHP Warning: preg_match() expects parameter 2 to be string, array given in /wp-includes/pluggable.php on line 385
[20-Mar-2020 21:55:51 UTC] PHP Warning: trim() expects parameter 1 to be string, array given in /wp-includes/class-phpmailer.php on line 873

Is anyone else getting this issue?

from wp_mail.

mukeshwani avatar mukeshwani commented on July 30, 2024

Hey folks, found the issue.... here:
return wp_mail($this->to, $this->buildSubject(), $this->render(), $this->buildHeaders(), $this->attachments);

this should be:
return wp_mail($this->to[0], $this->buildSubject(), $this->render(), $this->buildHeaders(), $this->attachments);

Seems like some code is creating a multi-dimensional array... I guess?

from wp_mail.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.