I am able to send email over the SOAP api using something similar to http://wiki.developerforce.com/page/Partner_Send_Email
However, I would like the emails to be associated with a particular Opportunity.
If the email is done through the UI this is possible and the email appears under the Opportunity's Activity History.
Is it possible to set this over the API?
Using targetObjectId gives
Only Users, Contact or Lead allowed for targetObjectId