+ Start a Discussion
Nikhil Shrigod 9Nikhil Shrigod 9 

Messaging.SingleEmailMessage

Can somebody please tell me that what is SingleEmailMessage in "Messaging.SingleEmailMessage".
I have uderstood that Messaging is a class but I haven't understood what is SingleEmailMessage. Is it a static method or innerclass or what?
Best Answer chosen by Nikhil Shrigod 9
Varun SinghVarun Singh
Hi Nikhil

Messaging is  not  a  class it is name space.
and SingleEmailMesssage is class 

Some methods in class
setBccAddresses(bccAddresses)
setCcAddresses(ccAddresses)
setHtmlBody(htmlBody)

For All methods and Constructors ,You will get all Information from this URL
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_single.htm

All Answers

Prakash NawalePrakash Nawale
Hi Nikhil,

SingleEmailMessage is inner class and it have set of different methods.
Please refer https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_single.htm
 
Varun SinghVarun Singh
Hi Nikhil

Messaging is  not  a  class it is name space.
and SingleEmailMesssage is class 

Some methods in class
setBccAddresses(bccAddresses)
setCcAddresses(ccAddresses)
setHtmlBody(htmlBody)

For All methods and Constructors ,You will get all Information from this URL
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_outbound_single.htm
This was selected as the best answer
GauravGargGauravGarg
Nikhil,

SingleEmailMesaage is a class provided by SFDC to send customize email on Business Requirement, other than SendEmail functionaltiy on Record page. 

This class need to be used in Apex code to write down your own requirement i.e. you can:
  1. Create custom template using apex code (html / text) type
  2. use existing templates. 
  3. Set multi level user's which are too not related to record. 
  4. Add multiple cc and bcc users. 
Many more. 

This is truly an awesome feature if you go along with Service Cloud team, as customer satisfaction team need to send out 1000's of email a day. 

Also, there are 5000 limit of email sent everyday
This limit excludes following:
  1. Email sent to USER, LEAD & contact. 
But if we are sending email to email Address then it will count for every email. 

Hope this helps. 

Thanks,
Gaurav
Skype:gaurav62990
Takes Freelance Job
KISALAY JOSHIKISALAY JOSHI
can SingleEmailMesaage send emails to external ids as well . As there is a 
setTargetObjectId(targetObjectId) . We cant specify ids for users who are not in salesfroce