Activity Forums Salesforce® Discussions Messaging.SendEmail Not working in Salesforce?

  • Manpreet

    Member
    April 26, 2018 at 5:28 pm

    Hi shubham,

    Following code works fine for me from developer console.

    Messaging.SingleEmailMessage mailTest = new Messaging.SingleEmailMessage();
    String[] toAddressesTest = new String[]{'[email protected]'};
    mailTest.setToAddresses(toAddressesTest);
    mailTest.setSubject('THIS IS A TEST____ SUBJECT LINE');
    mailTest.setHtmlBody('Hi from email');

    Messaging.SendEmail(new Messaging.SingleEmailMessage[] {mailTest});

    Thanks.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos