You need to sign in to do that
Don't have an account?
Ab
Attaching attachment to the email
Hello,
I want to implement the fucntionality of attaching document to a email.
As of now i am able to send email.
like below
Thank you for sugetions !
I want to implement the fucntionality of attaching document to a email.
As of now i am able to send email.
like below
Messaging.reserveSingleEmailCapacity(2); Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); String[] toAddresses = new String[] {'test@google.com'}; String[] ccAddresses = new String[] {'test@google.com'}; mail.setToAddresses(toAddresses); mail.setCcAddresses(ccAddresses); mail.setReplyTo('test@google.com'); mail.setSenderDisplayName('Support Team'); mail.setSubject('test Subject'); mail.setBccSender(false); mail.setUseSignature(false); mail.setHtmlBody('<html><body><p>Hello Text</p></body></html>'); Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });I want to improve it to let user choose file in "Computer" or "Salesforce document", attach the file and send it with email.
Thank you for sugetions !
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_email_sending_attachments.htm
In VF page, create an <apex:inputFile>, bind it to a blob variable in controller and then send it via email as shown in the post.
Hope this helps!
Veenesh