• jagdish sati
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Guys I need a little  help from u.
Below is the code for sending email.It works properly in another user account but when I use in my system it does not work.So please told what is the necessary setting for sending mail.I have already done Email Deliverability to All Email.

apex class

public class mainEmail{
public static void mailSend(){
List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
Messaging.SingleEmailMessage mail =  new Messaging.SingleEmailMessage();
List<String> sendTo = new List<String>();
      sendTo.add('sati.jagdish912@gmail.com');
      mail.setToAddresses(sendTo);
      mail.setReplyTo('sati.jagdish5@gmail.com');
      mail.setSenderDisplayName('Jagdish');
      mail.setSubject('URGENT BUSINESS PROPOSAL');
      mail.setHtmlBody('hhhihisadhuihd');
      mails.add(mail);
      Messaging.sendEmail(mails);
}
}

vfpage

<apex:page controller="mainEmail" action="{!mailSend}">

</apex:page>

Hi,

 

    I am using Vf Email Template which is used by Workflow. In the template i need to send the Attachment file of Attachment of the relatedTo object.Is there is any way to do it please let me know.

 

I know this can be done by using Apex trigger.but i need to send email by workflow

 

Thanks

 

Khillan Singh