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
abhishek gupta 299abhishek gupta 299 

Mail send functionality is not working on Einstein chatbot

I am trying to send email using einstein chatbot by implementing the action i.e Send email filed all values accordingly but the mail is not send and when I debug the response is IsSuccess=true.After I tried with invicable apex method and tried to send mail via 

 Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
            String emailAddress='abhishek.gupta@cloudanalogy.com';
            message.setSubject('Mail from bot');
            message.setToAddresses(new String[] {emailAddress});
            message.setHtmlBody('hii, thanks for giving us your time.');
            System.debug('message--> ' + message);
            Messaging.SendEmailResult [] r =Messaging.sendEmail(new Messaging.SingleEmailMessage[] { message });
But the issue remains same.
Let me know which permission I am missing here.
Thanks

Best Answer chosen by abhishek gupta 299
Akshay Dhiman 63Akshay Dhiman 63
Hi Abhishek, 
I have gone through your issue and find some steps which can solve your issue.
You need to change the user for your chatbot. This link will help you in resolving your issue.
https://help.salesforce.com/articleView?id=bots_service_add_profile.htm&type=5

Hope this explanation will resolve your query.Mark it as the best answer if you find it helpful.
Thanks
Akshay