You need to sign in to do that
Don't have an account?

email attachment
hi ,
I am working in a solution where i run a batch class which gives me the all the ids of an object based on some criteria. In this i need to collect all these ids and put it into a csv file and send an email with the csv file attached to the email.
Can anybody suggest me the code to accomplish this.
Use visualforce email templates to do that.
Take a look at this package as an example:
http://sites.force.com/appexchange/listingDetail?listingId=a0N300000016cYlEAI
Here is another example:
http://wiki.developerforce.com/index.php/VisualForceEmailTemplates_sample
hi rasmus thanks for the reply but in my case i want it the file to be a CSV file and send as an attahcment with the email.
You can do that with Visualforce email templates.
Add a component like this into the template, this example is a PDF, but easy to change into a csv
If you want to send an Email with Attachment a native salesforce app MassMailer DOCS is perfect for you.
MassMailer DOCS let’s you send mass email attachments to your leads or contacts while securely storing your files with Rackspace Cloud Files.
You can try this app by installing from appexchange -Massmailer Docs
You can learn more details about the product on this website - docs.massmailer.io