MimeMessage
classin packageklyn.mails
public class MimeMessage extends Message:
MIME message inspired by JavaMail `MimeMessage`, adapted to Klyn.
Common authoring flows are exposed as direct properties and small helper
methods instead of a large setter-based API.
import klyn.mails
message = MimeMessage()
message.from = InternetAddress("robot@example.com")
message.addTo("user@example.com")
message.subject = "Hello"
message.textBody = "Bonjour"
Properties
| Modifier and Type |
Member |
Description |
| public property |
htmlBody |
HTML body. |
| public property |
messageId |
Optional explicit Message-ID. |
| public property |
multipart |
Optional explicit MIME tree. |
| public property |
textBody |
Plain text body. |
Constructors
| Modifier and Type |
Member |
Description |
| public |
MimeMessage |
Creates a MIME message. |
Methods
| Modifier and Type |
Member |
Description |
| public |
attach |
Adds an attachment. |
| public |
attachBase64 |
Adds an attachment from Base64 content. |
| public |
attachBase64 |
Adds a Base64 attachment with an explicit content type. |
| public |
attachText |
Adds a text attachment. |
| public |
attachText |
Adds a text attachment with an explicit content type. |
| public override |
header |
Adds or replaces a custom message header. |
| public override |
render |
Renders this message as RFC 5322 text. |