You need to sign in to do that
Don't have an account?
khushbu dubey
hi..I have a doubt in this code that it can send email with attachment..
public class emailsend { public string subject{get; set;} public string emailbody{get;set;} public list<string> emails=new list<string>{'dubeykhushbu131191@gmail.com'}; public string attachment{get;set;} public pagereference send() { messaging.singleemailmessage email=new messaging.singleemailmessage(); email.setsubject(subject); email.setplaintextbody(emailbody); email.settoaddresses(emails); email.setccaddresses(emails); email.setbccaddresses(emails); messaging.sendemailresult[] r=messaging.sendemail(new messaging.singleemailmessage[]{email}); // Messaging.EmailFileAttachment attachfile= new Messaging.EmailFileAttachment(); // attachfile.setbody(attachment); return null; } list<document> doc=new list<document>(); document d=new document(); public pagereference save(){ d.Folderid='00l28000001ELDU'; d.name=attachment; insert d; doc=[select folderid from document where Folderid='00l28000001ELDU' ]; return null;} }
Refer this link for more details:
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_email_sending_attachments.htm
1) http://sfdcsrini.blogspot.com/2014/06/sending-email-with-attachment-using.html
2) http://www.salesforcetutorial.com/sending-email-attachment-emailfileattachment/
Sample code. Let us know if this will help you
Thanks
Amit Chaudhary
Please find the below code to send an email with attachment.
Also go through the below links:
http://www.salesforcetutorial.com/sending-email-attachment-emailfileattachment/
http://salesforce.stackexchange.com/questions/25115/send-email-with-attachment-dynamically
http://blog.jeffdouglas.com/2010/07/22/create-and-email-a-document-with-salesforce-com/
Please do let me know if it helps you.
Regards,
Mahesh
Thanks
Amit Chaudhary