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
jagdish satijagdish sati 

problem on sending email

Guys I need a little  help from u.
Below is the code for sending email.It works properly in another user account but when I use in my system it does not work.So please told what is the necessary setting for sending mail.I have already done Email Deliverability to All Email.

apex class

public class mainEmail{
public static void mailSend(){
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
Messaging.SingleEmailMessage mail =  new Messaging.SingleEmailMessage();
List<String> sendTo = new List<String>();
      sendTo.add('sati.jagdish912@gmail.com');
      mail.setToAddresses(sendTo);
      mail.setReplyTo('sati.jagdish5@gmail.com');
      mail.setSenderDisplayName('Jagdish');
      mail.setSubject('URGENT BUSINESS PROPOSAL');
      mail.setHtmlBody('hhhihisadhuihd');
      mails.add(mail);
      Messaging.sendEmail(mails);
}
}

vfpage

<apex:page controller="mainEmail" action="{!mailSend}">

</apex:page>
Vinit_KumarVinit_Kumar
The way I would approach is to check the debug logs and see what is happening there ??