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
Mk450Mk450 

FATAL_ERROR|Internal Salesforce.com Error

I am using lightning component. There is a component to send email with fields to, subject, body and send button, cancel button.
on send button it calls to apex method as below: 
@AuraEnabled 
    public static void sendMailMethod( String mMail ,String mSubject ,String mbody, String recId ){
        //Fetching user details for cc the user in mail
        User u = [SELECT Id, Name, Email, Phone, MobilePhone FROM User where id =: userInfo.getUserId()];
        //Attach pdf timesheet to the mail
        PageReference pdfPage = new PageReference('/apex/time_WeeklyPDF?id='+recId); 
        //Get VisualForce page data  
        Blob file1;
        if(Test.isRunningTest()) { 
            file1 = blob.valueOf('Unit.Test');
        } else {
            file1 = pdfPage.getContentAsPDF(); 
        }
        // convert VisualForce page to  PDF format
        Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();             
        // Create Attachment
        efa.setFileName('WeeklyTimesheetAsPDF.pdf');
        efa.setBody(file1);
        List<Messaging.SingleEmailMessage> mails =  new List<Messaging.SingleEmailMessage>();     
        // Step 1: Create a new Email
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        // Step 2: Set list of people who should get the email
        string[] toaddress = mMail.split(',');
        string[] ccAddresses = new String[]{u.Email};
            mail.setToAddresses(toaddress);
        // Step 3: Set who the email is sent from
        mail.setReplyTo('noreply@gmail.com'); // change it with your mail address.
        mail.setSenderDisplayName('salesforce User'); 
        // Step 4. Set email contents - you can use variables!
        mail.setSubject(mSubject);
        mail.setHtmlBody(mbody);
        mail.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});
        mail.setCcAddresses(ccAddresses);
        // Step 5. Add your email to the master list
        mails.add(mail);
        // Step 6: Send all emails in the master list
        Messaging.sendEmail(mails);
    }
It was working previously but today when i clicked on send button its giving error as "FATAL_ERROR|Internal Salesforce.com Error" in debug log and nothing happens.
Need help on workaround for this, Why this error comes??
shailendra singhaishailendra singhai
Hi I was getting the same issue; It is fixed now
   PageReference pdf = Page.PDFGenarator;
             pdf.setRedirect(true)
             pdf.getParameters().put('Id', conlist[0].accountid);  ///add shailendra  
I was missing upon last line
  pdf.getParameters().put('Id', conlist[0].ID);

may some where the incorrect ID is getting pass;