How to preserve SMTP server configuration? #2807
Unanswered
villegas97
asked this question in
Q&A
Replies: 1 comment
-
I recommend reading the docs for sending to lists, and base your code on the mailing list example, which does exactly what you ask, making use of keep-alive. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to send a few hundreds of emails (I have only around 10 addresses, but each of them can have a few dozens of emails to be sent individually) every day, but in my code I include the server configuration for every email I send, which is giving me problems with Google (which is my provider), because they limit the number of connections made to the server.
I have a while loop, which consumes my phpmailer class, which at the same time, sends the emails.
I made a script test to see if I could leave the server configuration out of the loop and send 3 emails without having to use the entire code for every email, but it didn't work, only sent 1. This is my test script:
What could I do to not connect to the smtp server before every email? It would be better if I only connect once for every address.
Beta Was this translation helpful? Give feedback.
All reactions