Partner Send Email

Sample Request Message-sendEmail Call-Partner API

POST https://na1.salesforce.com/services/Soap/u/9.0 HTTP/1.1 
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol
1.1.4322.573) 
Content-Type: text/xml; charset=utf-8  
SOAPAction: "" 
Content-Length: 510 
Expect: 100-continue 
Host: na1.salesforce.com 

<?xml version="1.0" encoding="utf-8"?>   
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:urn="urn:partner.soap.sforce.com"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Header>
     <urn:SessionHeader>
        <urn:sessionId>QwWsHJyTPW.1pd0_jXlNKOSU</urn:sessionId>
     </urn:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>
     <urn:sendEmail>
        <!--0 to 10 repetitions:-->
        <urn:messages xsi:type="urn:SingleEmailMessage">
           <urn:bccSender>true</urn:bccSender>
           <urn:emailPriority>High</urn:emailPriority>
           <urn:subject>Happy Holidays from Salesforce.com!</urn:subject>
           <urn:useSignature>true</urn:useSignature>
           <urn:targetObjectId>003D000000OXWVi</urn:targetObjectId>
           <urn:plainTextBody>Hello, this is a holiday greeting!</urn:plainTextBody>
        </urn:messages>
     </urn:sendEmail>
  </soapenv:Body>
</soapenv:Envelope>

Sample Response Message-sendEmail Call-Partner API

HTTP/1.1 200 OK 
Server: sfdc 
Content-Type: text/xml; charset=utf-8 
Transfer-Encoding: chunked 
Date: Tue, 29 May 2007 23:48:47 GMT
  
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns="urn:partner.soap.sforce.com">
  <soapenv:Body>
     <sendEmailResponse>
        <result>
           <success>true</success>
        </result>
     </sendEmailResponse>
  </soapenv:Body>
</soapenv:Envelope>

Back to Sample SOAP Messages