You need to sign in to do that
Don't have an account?
Trying to create my own e-mail form in Activity History
I created a custom object called "Graduates" Graduates in our organization are not contacts. However we would like to be able to send an e-mail from Salesforce to the graduate and have it be tracked in the Activity History. When we try and use the "Send An E-mail" button it only allows us to send e-mails to contacts
I was trying to setup this Java Script a Detail Page Button, I have Behavior set as "Execute Java Script" and Content Source as "OnClick JavaScript" however I am getting the following error
"A Problem with the OnClick JavaScript for this button or link was encountered:"
"Expected ';'"
Any idea how to correct this?
Thanks,
Jon
private void sendEmailSample() { byte[] fileBody = new byte[1000000]; EmailFileAttachment[] fileAttachments = new EmailFileAttachment[1]; EmailFileAttachment fileAttachment = new EmailFileAttachment(); fileAttachment.setBody(fileBody); fileAttachment.setFileName("attachment"); fileAttachments[0] = fileAttachment; SingleEmailMessage[] messages = new SingleEmailMessage[1]; messages[0] = new SingleEmailMessage(); messages[0].setBccAddresses(new String[] { "jdoe@acme.com", "jdoe@merce.com" }); messages[0].setCcAddresses(new String[] { "jdoe@gmail.com", "jdoe@salesforce.com" }); messages[0].setBccSender(true); messages[0].setEmailPriority(EmailPriority.High); messages[0].setReplyTo("dcarroll@salesforce.com"); messages[0].setSaveAsActivity(true); messages[0].setSubject("This is how you use the sendEmail call."); // We can also just use an id for an implicit to address messages[0].setTargetObjectId(new ID("003D0000005OV0g")); messages[0].setUseSignature(true); messages[0].setPlainTextBody("This is the humongous body of the message."); messages[0].setFileAttachments(fileAttachments); String[] toAddresses = new String[] { "jdoe@salesforce.com" }; messages[0].setToAddresses(toAddresses); // Now send the email. try { SendEmailResult[] result = binding.sendEmail(messages); if (result[0].isSuccess()) { System.out.println("The email was sent successfully."); } else { System.out.println("The email failed to send: " + result[0].getErrors(0).getMessage()); } } catch (UnexpectedErrorFault e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } }