1 Reply Latest reply: Jun 21, 2013 10:04 PM by Pgleghorn-Oracle RSS

    email set up in webcenter sites

    RajendarRaj

      Hello All,

      We have a very urgent requirement to configure email into oralce webcenter sites 11g R1. As per my requirement, we have a form, in that form there is a fields like : first name last name and email. After filling all the form, when we click on the submit button an email should sent to the email address of email field from the mail id custserv@xxxxx.com."\

       

      could you please provide step by step process to configure email setup in Oracle webcenter sites environment.

       

      Thanks

      Rajendar.

        • 1. Re: email set up in webcenter sites
          Pgleghorn-Oracle

          Here's an example:

           

          1. Ensure that these properties in futuretense.ini are set appropriately:

           

          futuretense.ini:cs.emailauthenticator=com.openmarket.framework.mail.ICSAuthenticator

          futuretense.ini:cs.emailcontenttype=

          futuretense.ini:cs.emailhost=localhost\:1125

          futuretense.ini:cs.emailaccount=admin@localhost

          futuretense.ini:cs.emailpassword=admin

          futuretense.ini:cs.emailcharset=

          futuretense.ini:cs.emailreturnto=

           

          in particular cs.emailhost should point to a SMTP server, and if it requires authentication that the username and password are specified in cs.emailaccount and cs.emailpassword. If you are using the JSK then it comes with Apache James mailserver running on port 1125 and the above default values should be fine.

           

          2. Create a form to send the mail. Many ways to do this, I created an uncached typeless Template called "MyMailer" with usage = "Element defines a whole HTML page and can be called externally":

           

          <%@ taglib prefix="cs" uri="futuretense_cs/ftcs1_0.tld"

          %><%@ taglib prefix="ics" uri="futuretense_cs/ics.tld"

          %><%@ taglib prefix="satellite" uri="futuretense_cs/satellite.tld"

          %><%@ taglib prefix="mail" uri="futuretense_cs/mail.tld"

          %><cs:ftcs>

           

          <satellite:form satellite="false" id="mailerform" method="POST" >

          <input type="hidden" name="pagename" value='<%=ics.GetVar("pagename") %>'/>

          First name <input type="text" name="firstname"/> <br/>

          Last name <input type="text" name="lastname"/> <br/>

          Email address <input type="text" name="emailaddress"/> <br/>

          <input type="submit"/>

          </satellite:form>

           

          <%

          String firstname = ics.GetVar("firstname");

          String lastname = ics.GetVar("lastname");

          String emailaddress = ics.GetVar("emailaddress");

          String body = firstname + " " + lastname + " " + emailaddress;

           

          if (firstname != null && lastname != null && emailaddress != null) {

            %>

            <mail:send

                 to="<%=emailaddress %>"

                 from="custserv@xxxxx.com"

                 subject="subject goes here"

                 body="<%=body %>"/>

            Mail sent

            <%

          }

          %>

          </cs:ftcs>

           

          3. Assuming you created the typeless Template in the Avisports sample site on the JSK, then you load it at

           

          http://localhost:<port>/cs/ContentServer?pagename=avisports/MyMailer

           

          4. Enter values in the fields and submit

           

          5. If you are watching James console output you will see it process the mail and send it on to the destination:

           

          INFO  03:30:46,016 | james.smtpserver | ID=2146860526 Connection established from localhost (127.0.0.1)

          INFO  03:30:46,213 | james.smtpserver | ID=2146860526 Successfully spooled mail Mail1371868246080-0937b28d-3962-42ef-909d-9a6f05727cc1 from custserv@xxxxx.com on 127.0.0.1 for [philstestuser@gmail.com]

          725272  James  INFO   [Camel Thread 6 - Split] openjpa.Runtime - The Entity "org.apache.james.mailbox.jpa.user.model.JPASubscription" was enhanced at level "2", but the current level of enhancement is "1,055,128".

          725275  James  INFO   [Camel Thread 6 - Split] openjpa.Runtime - A down level Entity was detected and logged. Please enable RUNTIME trace to see all down level Entities.

          INFO  03:31:07,061 | james.mailetcontext | Attempting delivery of Mail1371868246080-0937b28d-3962-42ef-909d-9a6f05727cc1-to-gmail.com to host gmail-smtp-in.l.google.com. at 173.194.66.26 from custserv@xxxxx.com for addresses [philstestuser@gmail.com]

          INFO  03:31:07,508 | james.mailetcontext | Mail (Mail1371868246080-0937b28d-3962-42ef-909d-9a6f05727cc1-to-gmail.com) sent successfully to gmail-smtp-in.l.google.com. at 173.194.66.26 from custserv@xxxxx.com for [philstestuser@gmail.com]

           

          Regards,

          Phil