+ Start a Discussion

apex scheduler to send emails

Here I want my apex scheduler to send emails on daily basis,
where email body :should have the list of contacts created today,ie., contacts and its related account..,this list should look like a csv file
email to: emails should be sent to respective account owners, having information of individual account and related contacts.

Can this be done using apex scheduler class.Any help would be appreciated..Thanks in advance..
Balaji Chowdary GarapatiBalaji Chowdary Garapati

The answer is yes! and here is how:

  First you might need to write a batch job which holds your logic. And a scheduler class which can be scheduled at regular intervals to run this batch job.

If you would like the user to see them as a table and lot more details in an organized fancy way instead of a plain list of contact names and their urls,then you might need to create a visualforce page email template, which displays data in your required format and use it for emailing.

Use ful links:

Batch Job:



Visualforce Email Tempalte:


Things to be cleared before coding:

  1) Does user need 1 email with all the contacts grouped by account name that he owns which were created on that day?
  2) Should there be links in visualforce email templates which land them on that particular record?

Hope it helps.,


@Balaji Chowdary Garapati

Yes, user need an email with all the contacts created today, grouped by account that he owns..
Vertex AdminVertex Admin

Do you have any sample code for this requirement?

Can you please share the code..

Murali Reddy