Clarity

  • 1.  Can we send an Email Appointment through CA PPM

    Posted Aug 08, 2017 09:13 AM

    I have the following script embedded in a process. But with this script, the connection is not getting established. I have added an image for more details.

     

    <gel:script xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:core="jelly:core" xmlns:fn="http://java.sun.com/jsp/jstl/functions"
    xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary"
    xmlns:obj="http://www.niku.com/xog/Object"
    xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary"
    xmlns:file="jelly:com.niku.union.gel.FileTagLibrary"
    xmlns:ftp="jelly:com.niku.union.gel.FTPTagLibrary"
    xmlns:util="jelly:util"
    xmlns:x="jelly:org.apache.commons.jelly.tags.xml.XMLTagLibrary"
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:sql="jelly:sql"
    xmlns:xog="http://www.niku.com/xog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <core:invokeStatic className="com.niku.union.config.ConfigurationManager" method="getInstance" var="config"/>
    <core:set value="${config.getProperties()}" var="config"/>
    <core:set value="${config.getMailServer().getHost()}" var="mailServer"/>
    <!-- Set up our email server variables You should abe able to get them off the properties file -->
    <gel:parameter var='mailHost' default='${mailServer}'/>
    <gel:parameter var='mailPort' default='25'/>
    <gel:parameter var='mailUser' default='test@test.com'/>
    <gel:parameter var='mailPasswod' default=''/>
    <gel:parameter var='mailFromAddress' default='test@test.com'/>
    <gel:parameter var='mailToAddress' default='test.test@excers.com'/>

    <!-- Place our mail settings in our properties object -->
    <core:new className='java.util.Properties' var='propertiesClass'/>
    <core:set value='${propertiesClass.put("mail.transport.protocol", "smtp")}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.socketFactory.port","587")}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory")}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.host", mailHost)}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.port", mailPort)}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.auth", "false")}' var="void" />
    <core:set value='${propertiesClass.put("mail.user", mailUser)}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.debug", "true")}' var='void' />

    <!-- Create session Object -->
    <core:invokeStatic var='sessionClass' className='javax.mail.Session' method='getInstance'>
    <core:arg type='java.util.Properties' value='${propertiesClass}'/>
    </core:invokeStatic>

    <!-- Set up our PasswordAuthentication to use with our mail session -->
    <core:new var='passwordAuthentication' className='javax.mail.PasswordAuthentication'>
    <core:arg type='java.lang.String' value='${mailUser}'/>
    <core:arg type='java.lang.String' value='${mailPasswod}'/>
    </core:new>
    <core:new var='uRLName' className='javax.mail.URLName'>
    <gel:log>mailHost: ${mailHost}</gel:log>
    <gel:log>mailPort: ${mailPort}</gel:log>
    <gel:log>mailUser: ${mailUser}</gel:log>
    <gel:log>mailPasswod: ${mailPasswod}</gel:log>
    <gel:log>mailFromAddress: ${mailFromAddress}</gel:log>
    <gel:log>mailToAddress: ${mailToAddress}</gel:log>
    <core:arg type='java.lang.String' value='smtp'/>
    <core:arg type='java.lang.String' value='${mailHost}'/>
    <core:arg type='int' value='-1'/>
    <core:arg type='java.lang.String' value=''/>
    <core:arg type='java.lang.String' value='${mailUser}'/>
    <core:arg type='java.lang.String' value='${mailPasswod}'/>
    <gel:log>uRLName: ${uRLName}</gel:log>
    </core:new>

    <core:invoke method='setPasswordAuthentication' on='${sessionClass}'>
    <core:arg type='javax.mail.URLName' value='${uRLName}'/>
    <core:arg type='javax.mail.PasswordAuthentication' value='${passwordAuthentication}'/>
    <gel:log>passwordAuthentication: ${passwordAuthentication}</gel:log>
    </core:invoke>
    <core:set value='${sessionClass.setDebug(true)}' var='void' />

    <!-- Create our MimeMessage Object -->
    <core:new var='mimeMessage' className='javax.mail.internet.MimeMessage'>
    <core:arg type='javax.mail.Session' value='${sessionClass}'/>
    <gel:log>sessionClass: ${sessionClass}</gel:log>
    </core:new>

    <!-- Set our headers for this message to VENENT -->
    <core:expr value='${mimeMessage.addHeaderLine("method=REQUEST")}' />
    <core:expr value='${mimeMessage.addHeaderLine("charset=UTF-8")}' />
    <core:expr value='${mimeMessage.addHeaderLine("component=VEVENT")}' />

    <!-- Build a From Address -->
    <core:new var='fromAddress' className='javax.mail.internet.InternetAddress'>
    <core:arg type='java.lang.String' value='${mailFromAddress}'/>
    </core:new>
    <core:new var='toAddress' className='javax.mail.internet.InternetAddress'>
    <core:arg type='java.lang.String' value='${mailToAddress}'/>
    </core:new>

    <!-- Set our message From / To / Subject values -->
    <core:invokeStatic className="java.lang.Class" method="forName" var="RecipientType">
    <core:arg type='java.lang.String' value='javax.mail.Message$RecipientType' />
    </core:invokeStatic>
    <core:set value='${recipientType.getField("TO")}' var='recipientTypeTO' />
    <core:set value='${recipientTypeTO.TO}' var='recipientTypeTO' />
    <core:set value='${recipientType.getField("CC")}' var='recipientTypeCC' />
    <core:set value='${recipientTypeCC.CC}' var='recipientTypeCC' />
    <core:set value='${recipientType.getField("BCC")}' var='recipientTypeBCC' />
    <core:set value='${recipientTypeBCC.BCC}' var='recipientTypeBCC' />
    <core:set value='${mimeMessage.setFrom(fromAddress)}' var='void' />
    <gel:log>toAddress: ${toAddress}</gel:log>
    <core:set value='${mimeMessage.setRecipient(recipientTypeTO, toAddress)}' var='void' />
    <core:expr value='${mimeMessage.setSubject("Outlook Meeting Request Using Gel")}' />;

    <!-- Build our ugly iCalendar in a string buffer -->
    <core:new var='stringBuffer' className='java.lang.StringBuffer' />
    <core:set var='newLine' value='${context.getVariable("line.separator")}' />
    <core:mute>
    <core:expr value='${stringBuffer.append("BEGIN:VCALENDAR"+newLine)}' />
    <core:expr value='${stringBuffer.append("PRODID:-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN"+newLine)}' />
    <core:expr value='${stringBuffer.append("VERSION:2.0"+newLine)}' />
    <core:expr value='${stringBuffer.append("METHOD:PUBLISH"+newLine)}' />
    <core:expr value='${stringBuffer.append("X-MS-OLK-FORCEINSPECTOROPEN:TRUE"+newLine)}' />
    <core:expr value='${stringBuffer.append("BEGIN:VTIMEZONE"+newLine)}' />
    <core:expr value='${stringBuffer.append("TZID:Pacific Standard Time"+newLine)}' />
    <core:expr value='${stringBuffer.append("BEGIN:STANDARD"+newLine)}' />
    <core:expr value='${stringBuffer.append("DTSTART:16011104T020000"+newLine)}' />
    <core:expr value='${stringBuffer.append("RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11"+newLine)}' />
    <core:expr value='${stringBuffer.append("TZOFFSETFROM:-0700"+newLine)}' />
    <core:expr value='${stringBuffer.append("TZOFFSETTO:-0800"+newLine)}' />
    <core:expr value='${stringBuffer.append("END:STANDARD"+newLine)}' />
    <core:expr value='${stringBuffer.append("BEGIN:DAYLIGHT"+newLine)}' />
    <core:expr value='${stringBuffer.append("DTSTART:16010311T020000"+newLine)}' />
    <core:expr value='${stringBuffer.append("RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3"+newLine)}' />
    <core:expr value='${stringBuffer.append("TZOFFSETFROM:-0800"+newLine)}' />
    <core:expr value='${stringBuffer.append("TZOFFSETTO:-0700"+newLine)}' />
    <core:expr value='${stringBuffer.append("END:DAYLIGHT"+newLine)}' />
    <core:expr value='${stringBuffer.append("END:VTIMEZONE"+newLine)}' />
    <core:expr value='${stringBuffer.append("BEGIN:VEVENT"+newLine)}' />
    <core:expr value='${stringBuffer.append("CLASS:PUBLIC"+newLine)}' />
    <core:expr value='${stringBuffer.append("CREATED:20170810T053000Z"+newLine)}' />
    <core:expr value='${stringBuffer.append("DTEND;TZID=Pacific Standard Time:20140926T160000"+newLine)}' />
    <core:expr value='${stringBuffer.append("DTSTAMP:20170810T060000Z"+newLine)}' />
    <core:expr value='${stringBuffer.append("DTSTART;TZID=Pacific Standard Time:20140926T150000"+newLine)}' />
    <core:expr value='${stringBuffer.append("LAST-MODIFIED:20170810T053000Z"+newLine)}' />
    <core:expr value='${stringBuffer.append("LOCATION:Friendly Watering Hole"+newLine)}' />
    <core:expr value='${stringBuffer.append("PRIORITY:5"+newLine)}' />
    <core:expr value='${stringBuffer.append("SEQUENCE:0"+newLine)}' />
    <core:expr value='${stringBuffer.append("SUMMARY;LANGUAGE=en-us:After Work Status Meeting"+newLine)}' />
    <core:expr value='${stringBuffer.append("TRANSP:OPAQUE"+newLine)}' />
    <core:expr value='${stringBuffer.append("UID:040000008200E00074C5B7101A82E00800000000609CB31B84D9CF01000000000000000"+newLine)}' />
    <core:expr value='${stringBuffer.append(" 01000000017C3704930350F43B81ED6789C58B791"+newLine)}' />
    <core:expr value='${stringBuffer.append("X-MICROSOFT-CDO-BUSYSTATUS:BUSY"+newLine)}' />
    <core:expr value='${stringBuffer.append("X-MICROSOFT-CDO-IMPORTANCE:1"+newLine)}' />
    <core:expr value='${stringBuffer.append("X-MICROSOFT-DISALLOW-COUNTER:FALSE"+newLine)}' />
    <core:expr value='${stringBuffer.append("X-MS-OLK-AUTOFILLLOCATION:FALSE"+newLine)}' />
    <core:expr value='${stringBuffer.append("X-MS-OLK-CONFTYPE:0"+newLine)}' />
    <core:expr value='${stringBuffer.append("BEGIN:VALARM"+newLine)}' />
    <core:expr value='${stringBuffer.append("TRIGGER:-PT15M"+newLine)}' />
    <core:expr value='${stringBuffer.append("ACTION:DISPLAY"+newLine)}' />
    <core:expr value='${stringBuffer.append("DESCRIPTION:Reminder"+newLine)}' />
    <core:expr value='${stringBuffer.append("END:VALARM"+newLine)}' />
    <core:expr value='${stringBuffer.append("END:VEVENT"+newLine)}' />
    <core:expr value='${stringBuffer.append("END:VCALENDAR"+newLine)}' />
    <gel:log>new line: ${newLine}</gel:log>
    </core:mute>
    <gel:log>${stringBuffer.toString()}</gel:log>


    <!-- Build up our MimeMultipart message -->
    <core:new var='mimeMultipart' className='javax.mail.internet.MimeMultipart' />
    <core:set value='${mimeMessage.setContent(mimeMultipart)}' var='void' />

    <!-- Message about the meeting -->
    <core:new var='messageBodyPartText' className='javax.mail.internet.MimeBodyPart' />
    <core:set value='${messageBodyPartText.setText("Please see attached meeting request")}' var='void' />
    <core:set value='${mimeMultipart.addBodyPart(messageBodyPartText)}' var='void' />

    <!-- Attached VCalendar -->
    <core:new var='messageBodyPartVcs' className='javax.mail.internet.MimeBodyPart' />
    <core:set value='${messageBodyPartVcs.setFileName("MeetingRequest.vcs")}' var='void' />
    <core:set value='${messageBodyPartVcs.setContent(stringBuffer.toString(), "text/plain")}' var='void' />
    <core:set value='${mimeMultipart.addBodyPart(messageBodyPartVcs)}' var='void' />

    <!-- Send our invite -->
    <core:set var='transport' value='${sessionClass.getTransport(uRLName)}' />
    <core:set var='connect' value='${transport.connect(mailHost, mailPort, mailUser, mailPasswod)}' />
    <gel:log>Connected = ${transport.isConnected()}</gel:log>
    <core:set var='void' value='${transport.send(mimeMessage)}' />
    <gel:log>mimeMessage : ${mimeMessage}</gel:log>
    </gel:script>

     

     

    Thanks in advance. 



  • 2.  Re: Can we send an Email Appointment through CA PPM

    Posted Aug 08, 2017 11:26 AM

    My guess is you need:

     

    mail.smtp.starttls.enable=true

     

    based on the smtp port 587.

     

    V/r,

    Gene



  • 3.  Re: Can we send an Email Appointment through CA PPM

    Posted Aug 09, 2017 05:14 AM

    Hi Gene,

     

    Where exactly do I add mail.smtp.starttls.enable=true ?

     

    Thanks,

    Vamshi



  • 4.  Re: Can we send an Email Appointment through CA PPM

    Posted Aug 09, 2017 05:37 AM

    Try setting via your propertiesClass object.

     

    <core:set value='${propertiesClass.put("mail.smtp.starttls.enable", true)}' var="void" />

     

    V/r,

    Gene



  • 5.  Re: Can we send an Email Appointment through CA PPM

    Posted Aug 09, 2017 05:46 AM

    I did the same even now I'm not getting any email don't know whats wrong.



  • 6.  Re: Can we send an Email Appointment through CA PPM

    Posted Aug 09, 2017 06:23 AM

    Taking another look at your script.  A couple of questions.

     

    Are you using the SMTP mail server configured in the properties file?

     

    As for ports.

     

    <core:set value='${propertiesClass.put("mail.smtp.socketFactory.port","587")}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.port", mailPort)}' var="void" />

     

    So the mailPort needs to be the port in which you communicate to the mail server (most likely 25, 465 or 587).  If you mail server listens on 25, I doubt you need any of the SSL properties as 25 is usually not encrypted.

     

    If you are using SSL or StartTLS, then the mail.smtp.socketFactory.port and mail.smtp.port need to be the same value.

     

    If your script that should be 587 but you have 587 and 25.


    V/r,

    Gene



  • 7.  Re: Can we send an Email Appointment through CA PPM

    Posted Aug 09, 2017 06:41 AM

    Hi Gene,

     

    Yes,  I am using  SMTP mail server configured in the properties file.

     

    case 1: When I set up 

    <core:set value='${propertiesClass.put("mail.smtp.socketFactory.port","587")}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.port", 25)}' var="void" />

    I get the connection is established successfully

     

    case 2: when I set up

    <core:set value='${propertiesClass.put("mail.smtp.socketFactory.port","465")}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.port", 25)}' var="void" />

    I get the connection is established successfully

     

    case 3: when I set up mail port as 465 or 587 

     

    <core:set value='${propertiesClass.put("mail.smtp.socketFactory.port","587")}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.port", 465 or 587)}' var="void" />

    I don't see the connection established

     

    Case 4: when I set up 

    <core:set value='${propertiesClass.put("mail.smtp.socketFactory.port","25")}' var="void" />
    <core:set value='${propertiesClass.put("mail.smtp.port", 25)}' var="void" />

    I don't see the connection established

     

    But in all the above conditions I am not getting any email. 

     

    Thanks for your patience.

    Vamshi



  • 8.  Re: Can we send an Email Appointment through CA PPM
    Best Answer

    Posted Aug 09, 2017 01:39 PM

    So I was able to get this script to work with port 25.  I commented out the mail.smtp.socketFactory.class as my port 25 is not SSL/StartTLS and mail.smtp.auth because I don't need to authorize.

     

    <gel:script 
        xmlns:core="jelly:core" 
        xmlns:util="jelly:util" 
        xmlns:x="jelly:xml" 
        xmlns:gel="jelly:com.niku.union.gel.GELTagLibrary" 
        xmlns:soap="jelly:com.niku.union.gel.SOAPTagLibrary" 
    >
     
     
        <!-- Set up our email server variables   You should abe able to get them off the properties file --> 
        <gel:parameter var='mailHost' default='localhost'/> 
        <gel:parameter var='mailPort' default='25'/> 
        <gel:parameter var='mailUser' default='user'/> 
        <gel:parameter var='mailPasswod' default='password'/> 
        <gel:parameter var='mailFromAddress' default='user@server.com'/> 
        <gel:parameter var='mailToAddress' default='user@server.com'/> 
     
        <!-- Place our mail settings in our properties object --> 
        <core:new className='java.util.Properties' var='propertiesClass'/> 
        <core:set value='${propertiesClass.put("mail.transport.protocol", "smtp")}' var="void" /> 
        <core:set value='${propertiesClass.put("mail.smtp.socketFactory.port","25")}' var="void" /> 
        <!-- <core:set value='${propertiesClass.put("mail.smtp.socketFactory.class","javax.net.ssl.SSLSocketFactory")}' var="void" />  -->
        <core:set value='${propertiesClass.put("mail.smtp.host", mailHost)}' var="void" /> 
        <core:set value='${propertiesClass.put("mail.smtp.port", mailPort)}' var="void" /> 
        <!-- <core:set value='${propertiesClass.put("mail.smtp.auth", "true")}' var="void" />  -->
        <core:set value='${propertiesClass.put("mail.user", mailUser)}' var="void" /> 
        <core:set value='${propertiesClass.put("mail.smtp.debug", "true")}' var='void' /> 
     
        <!-- Create session Object --> 
        <core:invokeStatic var='sessionClass' className='javax.mail.Session' method='getInstance'> 
            <core:arg type='java.util.Properties' value='${propertiesClass}'/> 
        </core:invokeStatic> 
     
        <!-- Set up our PasswordAuthentication to use with our mail session --> 
        <core:new var='passwordAuthentication' className='javax.mail.PasswordAuthentication'> 
            <core:arg type='java.lang.String' value='${mailUser}'/> 
            <core:arg type='java.lang.String' value='${mailPasswod}'/> 
        </core:new> 
        <core:new var='uRLName' className='javax.mail.URLName'> 
            <core:arg type='java.lang.String' value='smtp'/> 
            <core:arg type='java.lang.String' value='${mailHost}'/> 
            <core:arg type='int' value='-1'/> 
            <core:arg type='java.lang.String' value=''/> 
            <core:arg type='java.lang.String' value='${mailUser}'/> 
            <core:arg type='java.lang.String' value='${mailPasswod}'/> 
        </core:new> 
     
        <core:invoke method='setPasswordAuthentication' on='${sessionClass}'> 
            <core:arg type='javax.mail.URLName' value='${uRLName}'/> 
            <core:arg type='javax.mail.PasswordAuthentication' value='${passwordAuthentication}'/> 
        </core:invoke> 
        <core:set value='${sessionClass.setDebug(true)}' var='void' /> 
     
        <!-- Create our MimeMessage Object --> 
        <core:new var='mimeMessage' className='javax.mail.internet.MimeMessage'> 
            <core:arg type='javax.mail.Session' value='${sessionClass}'/> 
        </core:new> 
     
        <!-- Set our headers for this message to VENENT --> 
        <core:expr value='${mimeMessage.addHeaderLine("method=REQUEST")}' /> 
        <core:expr value='${mimeMessage.addHeaderLine("charset=UTF-8")}' /> 
        <core:expr value='${mimeMessage.addHeaderLine("component=VEVENT")}' /> 
     
        <!-- Build a From Address --> 
        <core:new var='fromAddress' className='javax.mail.internet.InternetAddress'> 
            <core:arg type='java.lang.String' value='${mailFromAddress}'/> 
        </core:new> 
        <core:new var='toAddress' className='javax.mail.internet.InternetAddress'> 
            <core:arg type='java.lang.String' value='${mailToAddress}'/> 
        </core:new> 
     
        <!-- Set our message From / To / Subject values --> 
        <core:invokeStatic className='java.lang.Class' method='forName' var='recipientType'> 
            <core:arg type='java.lang.String' value='javax.mail.Message$RecipientType' /> 
        </core:invokeStatic> 
        <core:set value='${recipientType.getField("TO")}' var='recipientTypeTO' /> 
        <core:set value='${recipientTypeTO.TO}' var='recipientTypeTO' /> 
        <core:set value='${recipientType.getField("CC")}' var='recipientTypeCC' /> 
        <core:set value='${recipientTypeCC.CC}' var='recipientTypeCC' /> 
        <core:set value='${recipientType.getField("BCC")}' var='recipientTypeBCC' /> 
        <core:set value='${recipientTypeBCC.BCC}' var='recipientTypeBCC' /> 
        <core:set value='${mimeMessage.setFrom(fromAddress)}' var='void' /> 
        <core:set value='${mimeMessage.setRecipient(recipientTypeTO, toAddress)}' var='void' /> 
        <core:expr value='${mimeMessage.setSubject("Outlook Meeting Request Using Gel")}' />
     
        <!-- Build our ugly iCalendar in a string buffer --> 
        <core:new var='stringBuffer' className='java.lang.StringBuffer' /> 
        <core:set var='newLine' value='${context.getVariable("line.separator")}' /> 
        <core:mute> 
            <core:expr value='${stringBuffer.append("BEGIN:VCALENDAR"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("PRODID:-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("VERSION:2.0"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("METHOD:PUBLISH"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("X-MS-OLK-FORCEINSPECTOROPEN:TRUE"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("BEGIN:VTIMEZONE"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("TZID:Pacific Standard Time"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("BEGIN:STANDARD"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("DTSTART:16011104T020000"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("TZOFFSETFROM:-0700"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("TZOFFSETTO:-0800"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("END:STANDARD"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("BEGIN:DAYLIGHT"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("DTSTART:16010311T020000"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("TZOFFSETFROM:-0800"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("TZOFFSETTO:-0700"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("END:DAYLIGHT"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("END:VTIMEZONE"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("BEGIN:VEVENT"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("CLASS:PUBLIC"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("CREATED:20140926T192104Z"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("DTEND;TZID=Pacific Standard Time:20140926T160000"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("DTSTAMP:20140926T192104Z"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("DTSTART;TZID=Pacific Standard Time:20140926T150000"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("LAST-MODIFIED:20140926T192104Z"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("LOCATION:Friendly Watering Hole"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("PRIORITY:5"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("SEQUENCE:0"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("SUMMARY;LANGUAGE=en-us:After Work Status Meeting"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("TRANSP:OPAQUE"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("UID:040000008200E00074C5B7101A82E00800000000609CB31B84D9CF01000000000000000"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("    01000000017C3704930350F43B81ED6789C58B791"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("X-MICROSOFT-CDO-BUSYSTATUS:BUSY"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("X-MICROSOFT-CDO-IMPORTANCE:1"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("X-MICROSOFT-DISALLOW-COUNTER:FALSE"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("X-MS-OLK-AUTOFILLLOCATION:FALSE"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("X-MS-OLK-CONFTYPE:0"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("BEGIN:VALARM"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("TRIGGER:-PT15M"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("ACTION:DISPLAY"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("DESCRIPTION:Reminder"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("END:VALARM"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("END:VEVENT"+newLine)}' /> 
            <core:expr value='${stringBuffer.append("END:VCALENDAR"+newLine)}' /> 
        </core:mute> 
        <gel:log>${stringBuffer.toString()}</gel:log> 
     
        <!-- Build up our MimeMultipart message --> 
        <core:new var='mimeMultipart' className='javax.mail.internet.MimeMultipart' />  
        <core:set value='${mimeMessage.setContent(mimeMultipart)}' var='void' /> 
     
        <!-- Message about the meeting --> 
        <core:new var='messageBodyPartText' className='javax.mail.internet.MimeBodyPart' /> 
        <core:set value='${messageBodyPartText.setText("Please see attached meeting request")}' var='void' /> 
        <core:set value='${mimeMultipart.addBodyPart(messageBodyPartText)}' var='void' /> 
     
        <!-- Attached VCalendar --> 
        <core:new var='messageBodyPartVcs' className='javax.mail.internet.MimeBodyPart' /> 
        <core:set value='${messageBodyPartVcs.setFileName("MeetingRequest.vcs")}' var='void' /> 
        <core:set value='${messageBodyPartVcs.setContent(stringBuffer.toString(), "text/plain")}' var='void' /> 
        <core:set value='${mimeMultipart.addBodyPart(messageBodyPartVcs)}' var='void' /> 
     
        <!-- Send our invite --> 
        <core:set var='transport' value='${sessionClass.getTransport(uRLName)}' /> 
        <core:set var='connect' value='${transport.connect(mailHost, mailPort, mailUser, mailPasswod)}' /> 
        <gel:log>Connected = ${transport.isConnected()}</gel:log> 
        <core:set var='void' value='${transport.send(mimeMessage)}' /> 
     
    </gel:script>

     

     

    I run the script and see that it connect to the SMTP server.

     

     

    I see the mail sitting in my simple little smtp server.

     

     

     

    I open the email as see the invite.

     

     

     

     

    V/r,

    Gene



  • 9.  Re: Can we send an Email Appointment through CA PPM

    Posted Aug 09, 2017 02:23 PM

    Thank you, Gene, That worked. 

     

    Vamshi.



  • 10.  Re: Can we send an Email Appointment through CA PPM

    Posted Aug 10, 2017 01:26 PM

    Nice, I am going to have to try this.