Subversion Repositories javautils

Rev

Rev 3 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 9
Line 1... Line 1...
1
package de.viathinksoft.utils.mail.sender;
1
package de.viathinksoft.utils.mail.sender;
2
 
2
 
3
import javax.mail.MessagingException;
3
import javax.mail.MessagingException;
4
 
4
 
5
import de.viathinksoft.utils.mail.EMailAddress;
5
import de.viathinksoft.utils.mail.EMailAddress;
6
import de.viathinksoft.utils.mail.InvalidMailAddressException;
-
 
7
 
6
 
8
public class PlainTextMailSender extends RawMailSender {
7
public class PlainTextMailSender extends RawMailSender {
9
       
8
       
10
        // --- E-Mail-Adressobjekt benutzen (dekodiert automatisch den Punycode)
9
        // --- E-Mail-Adressobjekt benutzen (dekodiert automatisch den Punycode)
11
       
10
       
12
        public void setMailFrom(String mailFrom) throws InvalidMailAddressException {
11
        public void setMailFrom(String mailFrom) {
13
                this.setMailFrom(new EMailAddress(mailFrom));
12
                this.setMailFrom(new EMailAddress(mailFrom));
14
        }
13
        }
15
 
14
 
16
        public void setMailFrom(EMailAddress mailFrom) throws InvalidMailAddressException {
15
        public void setMailFrom(EMailAddress mailFrom) {
17
                if (mailFrom == null) throw new InvalidMailAddressException();
-
 
18
                super.setMailFrom(mailFrom.getMailAddressPunycodedDomain());
16
                super.setMailFrom(mailFrom.getMailAddressPunycodedDomain());
19
        }
17
        }
20
 
18
 
21
        public void setRecipient(String recipient) throws InvalidMailAddressException {
19
        public void setRecipient(String recipient) {
22
                this.setRecipient(new EMailAddress(recipient));
20
                this.setRecipient(new EMailAddress(recipient));
23
        }
21
        }
24
 
22
 
25
        public void setRecipient(EMailAddress recipient) throws InvalidMailAddressException {
23
        public void setRecipient(EMailAddress recipient) {
26
                if (recipient == null) throw new InvalidMailAddressException();
-
 
27
                super.setRecipient(recipient.getMailAddressPunycodedDomain());
24
                super.setRecipient(recipient.getMailAddressPunycodedDomain());
28
        }
25
        }
29
       
26
       
30
        // --- PlainText Implementieren
27
        // --- PlainText Implementieren
31
       
28