sebb        2004/08/19 10:35:52

  Modified:    src/components/org/apache/jmeter/reporters MailerModel.java
  Log:
  Add sendTestMail method
  
  Revision  Changes    Path
  1.7       +23 -2     
jakarta-jmeter/src/components/org/apache/jmeter/reporters/MailerModel.java
  
  Index: MailerModel.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/components/org/apache/jmeter/reporters/MailerModel.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MailerModel.java  29 May 2004 12:31:09 -0000      1.6
  +++ MailerModel.java  19 Aug 2004 17:35:51 -0000      1.7
  @@ -314,7 +314,28 @@
           msg.setText(attText);
           Transport.send(msg);
       }
  +    public synchronized void sendTestMail()
  +            throws UnknownHostException, AddressException, MessagingException
  +        {
  +             String to = getToAddress();
  +            String from = getFromAddress();
  +             String subject = "Testing mail-addresses";
  +             String smtpHost = getSmtpHost();
  +             String attText = "JMeter-Testmail" + "\n" 
  +                     + "To:  " + to + "\n"
  +                     + "From: " + from + "\n"
  +            + "Via:  " + smtpHost + "\n"
  +                     + "Fail Subject:  " + getFailureSubject() + "\n"
  +            + "Success Subject:  " + getSuccessSubject();
   
  +             log.info(attText);
  +
  +             Vector destination= new Vector();
  +            destination.add(to);
  +
  +             sendMail(from, destination, subject, attText, smtpHost);
  +            log.info("Test mail sent successfully!!");
  +        }
       // ////////////////////////////////////////////////////////////
       //
       // setter/getter - JavaDoc-Comments not needed...
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to