# Email Control Interface

The Email control supports send e-mail operations using the Extensible mechanism. You set up a JCX file specifying the send-email attributes. The supported types for the content of the e-mail body are XmlObject and String.

The following are the Email control methods:

    package com.bea.control;

    /**
     * Email control interface
     */
    public interface EmailControl extends Control, Extensible
    {
        /**
         * Sets the dynamic properties for the control
         * @param xmlProp  the dynamic properties for the control
         */
         public void
             setProperties(EmailControlPropertiesDocument xmlProp);

        /**
         * Get the properties set for this control.
         * @return the dynamic properties for the control.
         * NULL if the control has not been initialized yet.
         */

         public EmailControlPropertiesDocument getProperties();

    }

### Sample Extended Email Control

The following code shows an example of an extended control. This code is automatically created by the control wizard.

    package jc.emailControl;

    import weblogic.jws.*;
    import com.bea.control.*;
    import com.bea.xml.XmlObject;

    /**
     * A custom Email control.
     * @jc:email  smtp-address="myorg.mymailserver.com:25"
     *             from-address="joe.user@myorg.com"
     *             from-name="Joe User"
     *             reply-to-address=""
     *             reply-to-name=""
     *             header-encoding=""
     *             username=""
     *             password=""
     *
     */
    public interface myFileControl extends
     EmailControl,com.bea.control.ControlExtension
    {
       /**
        * @jc:send-email to="{to}"
        *                 cc="{cc}"
        *                 bcc="{bcc}"
        *                 subject="{subject}"
        *                 body="{body}"
        *                 attachments="{attachments}"
        *                 content-type="text/plain"
        */
        void sendEmail(String to, String cc, String bcc, String subject,
                       String body, String attachments);
    }