Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: joist/java/org/joist/mail Emailer.java

Project highlights: Architectural Overview

joist
Discussion topic

Back to topic list

CVS update: joist/java/org/joist/mail Emailer.java

Author davidp
Full name David C. Pellegrini
Date 2000-10-16 02:21:10 PDT
Message User: davidp
  Date: 00/10/16 02:21:10

  Modified: java/org/joist/mail Emailer.java
  Log:
  Removed sourcexchange reference from generic sender ("notifier@...") by getting
  the mail host as a property.
  
  Revision Changes Path
  1.14 +16 -7 joist/java/org/joist​/mail/Emailer.java
  
  Index: Emailer.java
  ====================​====================​====================​=======
  RCS file: /cvs/joist/java/org/​joist/mail/Emailer.j​ava,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Emailer.java 2000/08/14 05:49:29 1.13
  +++ Emailer.java 2000/10/16 09:21:10 1.14
  @@ -51,6 +51,8 @@
   import javax.mail.internet.*;
   
   import org.joist.*;
  +import org.joist.util.*;
  +
   import org.webmacro.util.*;
   
   /**
  @@ -58,7 +60,7 @@
     * underlying java mail facility.
     *
     * @author David C. Pellegrini <A HREF="mailto:davidp@​dataweb-systems.com"​>davidp@dataweb-s​ystems.com</A>​
  - * @version $Revision: 1.13 $
  + * @version $Revision: 1.14 $
     *
     * Copyright (c) 1999 dataweb systems, inc.
     * Copyright (c) 1999, 2000 Collab.Net, Inc.
  @@ -68,8 +70,6 @@
   {
       static private Log log = new Log("emailer", "Emailer");
       static private boolean debug = true;
  - static private String sender = "notifier at sourcexchange dot com";
  -
   
       /**
        * Sends an email message from the system to a single recipient
  @@ -83,13 +83,16 @@
       sendEmail(String recipient, String subject, String body)
       throws JoistException
       {
  + StringBuffer sender = new StringBuffer("notifier@");
  + sender.append((String) JoistProperties.getP​roperty("MAIL_HOST")​);
  +
       try
       {
           Properties properties = System.getProperties();
           Session session = Session.getDefaultIn​stance(properties, null);
           Message message = new MimeMessage(session);
           message.setSentDate(new Date());
  - message.setFrom(new InternetAddress(sender));
  + message.setFrom(new InternetAddress(send​er.toString()));
           message.setRecipient​(Message.RecipientTy​pe.TO,
           new InternetAddress(recipient));
           message.setSubject(subject);
  @@ -120,12 +123,15 @@
       sendEmail(Vector recipients, String subject, String body)
       throws JoistException
       {
  + StringBuffer sender = new StringBuffer("notifier@");
  + sender.append((String) JoistProperties.getP​roperty("MAIL_HOST")​);
  +
       try
       {
           Properties properties = System.getProperties();
           Session session = Session.getDefaultIn​stance(properties, null);
           Message message = new MimeMessage(session);
  - message.setFrom(new InternetAddress(sender));
  + message.setFrom(new InternetAddress(send​er.toString()));
           InternetAddress[] toAddresses = new InternetAddress[reci​pients.size()];
           for (int i = 0; i < recipients.size(); i++)
           {
  @@ -165,12 +171,15 @@
       String body)
       throws JoistException
       {
  + StringBuffer sender = new StringBuffer("notifier@");
  + sender.append((String) JoistProperties.getP​roperty("MAIL_HOST")​);
  +
       try
       {
           Properties properties = System.getProperties();
           Session session = Session.getDefaultIn​stance(properties, null);
           Message message = new MimeMessage(session);
  - message.setFrom(new InternetAddress(sender));
  + message.setFrom(new InternetAddress(send​er.toString()));
           message.setSentDate(new Date());
           InternetAddress[] toAddresses = new InternetAddress[reci​pients.size()];
           for (int i = 0; i < recipients.size(); i++)
  @@ -349,7 +358,7 @@
       getProjectList(String projectID)
       {
       StringBuffer listName = new StringBuffer("project");
  - String mailHost = System.getProperty("​org.sourcexchange.ma​ilhost");
  + String mailHost = (String) JoistProperties.getP​roperty("MAIL_HOST")​;
       listName.append(proj​ectID).append("@" + mailHost);
       return listName.toString();
       }

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: joist/java/org/joist/mail Emailer.java davidp David C. Pellegrini 2000-10-16 02:21:10 PDT
Messages per page: