You need to sign in to do that
Don't have an account?
rupesh ranjan
Problem is not getting mail to List mail of address
Problem is not getting mail to List mail of address only mail goes to "rupesh@webmindinfotech.com". But i want List of mail that should be fire.
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
List<String> toAddress =new List<String>();
String emailadd = 'rupesh@webmindinfotech.com';
List<String> toAddresses = emailadd.split(';');
email.setToAddresses(toAddresses );
email.setSubject(subject);
email.setPlainTextBody(body);
email.setBccSender(true);
Messaging.SendEmailResult [] res = Messaging.SendEmail(new Messaging.SingleEmailMessage[] {email});
for ( Messaging.sendEmailResult result : res ) {
if ( !res[0].isSuccess () ) {
System.debug ( result );
}
else{
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email Sent Successfully' );
ApexPages.addMessage(msg);
}
}
return null;
}
public SendEmail(){
body = apexpages.currentpage().getparameters().get('att');
}
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
List<String> toAddress =new List<String>();
String emailadd = 'rupesh@webmindinfotech.com';
List<String> toAddresses = emailadd.split(';');
email.setToAddresses(toAddresses );
email.setSubject(subject);
email.setPlainTextBody(body);
email.setBccSender(true);
Messaging.SendEmailResult [] res = Messaging.SendEmail(new Messaging.SingleEmailMessage[] {email});
for ( Messaging.sendEmailResult result : res ) {
if ( !res[0].isSuccess () ) {
System.debug ( result );
}
else{
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email Sent Successfully' );
ApexPages.addMessage(msg);
}
}
return null;
}
public SendEmail(){
body = apexpages.currentpage().getparameters().get('att');
}
1) http://amitsalesforce.blogspot.in/2015/11/singleemailmessage-vs-massemailmessage.html Let us know if this will help you
In your list only one email address is present so it's going to that email only, Did you check with providing more than one email with ; seperated ?
String emailadd = 'sandeep.sankhla@trekbin.com;rajesh.kamath@trekbin.com'; I have used this and got email on both the addresses.
Thanks!
you have entered sandeep.sankhla@trekbin.com;rajesh.kamath@trekbin.com stacially right??
But my point is "To Address:- will be any thing dont know (dynamically)" and it should be more than 10.
So Whats the code for this??
Can you elaborate more what exactly is your need? with example so I can help you out?
As far as I understood you want to send email to approx 10 people and that should be dynamic, so you can get the list and then you can set the list to toAddresses....
Thanks!
Check below post for more info
http://amitsalesforce.blogspot.in/search/label/Email
sandeep.sankhla@trekbin.com is my email id.
Thanks!
two extensions="AccountSelectClassController,SendEmail"
Send Email is for Mail
and AccountSelectClassController is to select multpile contact Email Id in To Address
Now i need to do is send email to multiple contacts
@Sandeep