function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Narresh kumarNarresh kumar 

How can we save send email information in Activity History as a related list of case objects.

here my class is

               case cse=[select id,ContactEmail,Contactid,Email__c,CaseNumber from case where id=:caseid];
               Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 
               mail.setSubject('New Case created ');  
               body = cs.Email__c;
               Messaging.SendEmailResult[] result = Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail}); 
Here activity History is stored in contact detail page related list 
But  that is not my  Requirement  
i want store Activity history in case dateil page related list
Raj VakatiRaj Vakati
Hi ,
Use this code.
case cse=[select id,ContactEmail,Contactid,Email__c,
          CaseNumber from case where id='5004100000ADPDZ'];

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 

mail.setSubject('New Case created ');  
String body = cse.Email__c;

Messaging.SendEmailResult[] result = Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});

Sekhar SekharSekhar Sekhar
Thank You Rajamohan