You need to sign in to do that
Don't have an account?
how can I send multiple request in a single http.send() method
Hello Support,
I am using below code for sending emails.I need to send bulk Email from Salesforce.but here I am facing Error with
Too many future calls: 11
Can you please let me know how can I send multiple request in a single http.send() method.
//send the email
@future (callout=true)
public static void SendElasticEmailBulk(String userName, String APIKey, String fromEmail,
String fromName, String subject,list<String> lstEmailWithMessage) {
Http http = new Http();
for(string strEmailMessage :lstEmailWithMessage){
string[] arrSplitResult = strEmailMessage.split('#',2);
HttpRequest req = new HttpRequest();
HTTPResponse res;
req.setEndpoint('https://api.elasticemail.com/mailer/send')
;
req.setMethod('POST');
try {
//Construct the data
String data = 'userName=' + userName;
data += '&api_key=' + APIKey;
data += '&from=' + fromEmail;
data += '&from_name=' + fromName;
data += '&subject=' + EncodingUtil.urlEncode(subject, 'UTF-8');
data += '&body_html=' + EncodingUtil.urlEncode(arrSplitResult[1], 'UTF-8');
data += '&reply_to='+Label.Inbound_Email;
data += '&to=' + arrSplitResult[0];//Email Address
req.setBody(data);
http.send(req);
}
catch(Exception e) {
Alert.Emailmessage('Error on Execption'+string.valueOf(e));
}
}
Thanks for your time board.
All Answers
I am also facing same issue. Can any one help us.
Bhup
Thanks for your time board.
Thanks for Reply,
But I need send more then 10 request from salesforce is it possible?