As Patrick said, you have an error in the logic of your program. Currently your algorithm is:
- (we don't see in your code, but you create both the send request and document objects here)
- Loop
- add one attachment
- add one recipient ("create address & add recipient part")
- send email
- End of loop
Now, consider Patrick's answer:
Patrick van Nierop wrote:
Try removing the lo_send_request->send( ) part from the loop..In fact, your loop only needs to include the create address & add recipient part..
So:
Create a send request only once, add the body, subject & sender only once.
Then add recipients with a loop, and send only once..