Skip to Content
avatar image
Former Member

How to send email from C4C without Outlook Integration? EmailActivity is depricated; Activity BO?

Hi All,

I am trying to trigger a mail on click of a button in C4C.

I tried using EmailActivity BO for the same but the same is depricated. Can we use Activity BO to send mail? Activity has similar fields but the issue is assigning the values to the fields like MailTo, MailFrom etc.. these fields are locked as Read only and more over I need to send the mail from the button which is in a custom BO and not Activity BO. Is there a way to get this done?

Thanks,

Srihari.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Mar 01, 2017 at 12:05 PM

    Hello Srihari,

    For me the code below works.

    Bye,
    . Horst

    import ABSL;
    import AP.Common.GDT;
    import AP.PlatinumEngineering as Platinum;
    import DocumentServices.Global;
    
    // receipients
    var Receipients	        : EmailRecepientDataTable;
    var EmailReceipient	: EmailRecepientData;
    EmailReceipient.EmailRecepientTypeCode = "TO";
    EmailReceipient.EmailUri.content = "foo@bar.com"; 
    Receipients.EmailData.Add(EmailReceipient);
    
    // subject
    var Subject : XPEString;
    Subject = "Test E-Mail";
    
    // body
    var Body : XPEStringTab;
    var Line : XPEString;
    Line = "Hello - Goodbye";
    Body.XPEString.Add( Line );
    
    // send e-mail
    Mail.Send( Subject, Body, From, Receipients);
    Add comment
    10|10000 characters needed characters exceeded

  • Feb 23, 2017 at 07:28 AM

    Hello srihari,

    • Go to Business Config > Open Activity List > Fine Tune > Email and Fax Settings
    • Select Email and Fax Settings
    • Add the allowed Sender Email Domain for e.g. company.com
    • Add the allowed Sender Email Sub Domain for e.g. contact@company.com
    • Add the default sender address for e.g. donotreply@company.com

    Hope this config steps will helps you.

    Thanks

    Happy

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Happy,

      This is already configured in my Tenant.

      Even then the mail is not getting triggered.

      Thanks,

      Srihari.

  • Feb 23, 2017 at 11:48 PM

    Hello Srihari,

    Check the following blogs that may help:

    how-to-send-an-email-with-attachments-in-sap-cloud-application-studio

    c4c-email-with-attachment.html

    tutorial-sending-emails-from-byd

    Let us know how it goes.

    Regards

    Suchita

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Suchita,

      Based on the blogs i have done the below coding, I have debugged the code and debug goes fine, but there is no mail.

      Please suggest

      import ABSL;
      import AP.PC.ActivityManagement.Global;
      import AP.Common.GDT as GlobalDataTypes;
      
      //Email vars
      var elActivityRoot : elementsof Activity; 
      var instActivity; 
      var elActivityParty: elementsof Activity.Party;
      		//Type of Activity(Email = 39)
              elActivityRoot.TypeCode = "39";
      		//Subject
              elActivityRoot.SubjectName = "OAM Registration"; 
      		//Create new instance
      		instActivity = Activity.Create(elActivityRoot);
      		//Set Email From
      		elActivityParty.PartyName = "5000000009";
      		instActivity.MessageFromParty.Create(elActivityParty); 
      		//Set Email To
      		elActivityParty.PartyName = "5000000009";
      		instActivity.MessageToParty.Create(elActivityParty);
      		//Set Email Person Responsible
      		elActivityParty.PartyName = "5000000009";
      		instActivity.EmployeeResponsibleParty.Create(elActivityParty);
      		
      		//Send Email
      		instActivity.SendMail();
      
      Thanks,