PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
jayshields wrote:Are you trying this on your home server? Running Windows?
Have you changed the SMTP settings in your php.ini file?
It works... just not when I try to do this.
Otherwise I can send SMTP fine... just not when I add multiple addresses this way.
I find it hard to believe you. Try sending to one address in the exact same script, just remove all other AddAddress calls except one. Does it work? If it does, I can't help you any further. Sorry.
jayshields wrote:Are you trying this on your home server? Running Windows?
Have you changed the SMTP settings in your php.ini file?
It works... just not when I try to do this.
Otherwise I can send SMTP fine... just not when I add multiple addresses this way.
I find it hard to believe you. Try sending to one address in the exact same script, just remove all other AddAddress calls except one. Does it work? If it does, I can't help you any further. Sorry.
Okay, I must not have been clear.
I am only doing ONE AddAddress call.
Before I do the call, I am concatenating all the addresses into one variable
I am adding that variable (with multiple addresses concatenated inside of it)
And it fails.
If I just add a regular email address, it works fine.
That's because you're not supposed to interface with PHPMailer like that. You have to call addAddress() multiple times with the correct parameters. It's trying to use your concatenated string in the RCPT envelope command directly. That's not how SMTP works; SMTP has to call RCPT multiple times itself.
d11wtq wrote:That's because you're not supposed to interface with PHPMailer like that. You have to call addAddress() multiple times with the correct parameters. It's trying to use your concatenated string in the RCPT envelope command directly. That's not how SMTP works; SMTP has to call RCPT multiple times itself.