1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package mocks;
17
18 import javax.mail.Address;
19 import javax.mail.MessagingException;
20 import javax.mail.internet.AddressException;
21
22 import org.kuali.rice.core.mail.Mailer;
23
24 public class MockMailer extends Mailer{
25
26
27
28
29 @Override
30 public void sendMessage(String sender, Address[] recipients,
31 String subject, String messageBody, Address[] ccRecipients,
32 Address[] bccRecipients, boolean htmlMessage)
33 throws AddressException, MessagingException {
34
35 String toValue = "";
36 for(Address a: recipients){
37 toValue += a.toString();
38 }
39
40 String fromValue = (sender == null) ? "" : sender;
41 String subjectValue = (subject == null) ? "" : subject;
42 String bodyValue = (messageBody == null) ? "" : messageBody;
43 LOG.info("\nWILL NOT send e-mail message with to '" + toValue + "'... \nfrom '" + fromValue + "'... \nsubject '" + subjectValue + "'... and \nbody '" + bodyValue);
44 }
45 }