eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'EMailContentDescription':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: EMailContentDescription


Inheritance:

   Object
   |
   +--EMailContentDescription

Package:
stx:goodies/communication
Category:
Net-Communication-EMail
Version:
rev: 1.16 date: 2018/04/24 07:57:21
user: cg
file: EMailContentDescription.st directory: goodies/communication
module: stx stc-classLibrary: communication

Description:


SR:
this class represents the content of an email,
the content is everything which has nothing to do with the e.g. sender, receiver, smtp client
it is just the readable content like subject plainText html attachments
    


Class protocol:

examples
o  examples
|eMailContentDescription smtp|

eMailContentDescription := self new.
eMailContentDescription subject:'sdfsdfsdf'.
eMailContentDescription subject:'Subject - ç¬å举·'.
eMailContentDescription plainText:'a plain text example: äöüßßß'.
eMailContentDescription html:'<div>an html text example: <b>äöüßßß</b></div>'.
eMailContentDescription
addAttachment:(Filename newTemporary contents:'content of text file'; yourself)
contentType:'text/plain'.

smtp := SMTPClient new.
smtp
connectTo:'exeptn'
port:nil
user:'info'
password:nil.

smtp
sendMessageString:eMailContentDescription content
withSubject:eMailContentDescription subject
contentType:eMailContentDescription contentType
to:'stefan@exept.de'.

smtp close.

instance creation
o  new
(comment from inherited method)
return an instance of myself without indexed variables


Instance protocol:

accessing
o  html: something
do not use empty string for nil here,
because this would send an html email withoit content instead of an text email

o  plainText: something
not supported

o  subject: something
not supported

adding
o  addAttachment: aFilename contentType: aContentType

constants
o  alternativeContentType

o  charset

o  htmlContentType

o  mixedContentType

o  plainTextContentType

initialization
o  initialize
(comment from inherited method)
just to ignore initialize to objects which do not need it

private
o  contentBoundaryEnd: aBoundary on: aStream

o  contentOrBlock: aTextOrBlock splitter: aSplitter on: aStream

o  contentSeparatorOn: aStream

o  contentSplitter: aSplitter on: aStream

o  contentType: aContentType charset: aCharset boundary: aBoundary encoding: anEncoding disposition: aDisposition name: aName baseName: aBaseName on: aStream

o  textOrBlockOrAttachmentDescription: aTextOrBlockOrAttachmentDescription type: aContentType charset: aCharset splitter: aSplitter boundary: aBoundary on: aStream

queries
o  content

o  contentType

o  subject


Private classes:

    AttachmentDescription

Examples:


|eMailContentDescription smtp| eMailContentDescription := self new. eMailContentDescription subject:'sdfsdfsdf'. eMailContentDescription subject:'Subject - ç¬å举·'. eMailContentDescription plainText:'a plain text example: äöüßßß'. eMailContentDescription html:'<div>an html text example: <b>äöüßßß</b></div>'. eMailContentDescription addAttachment:(Filename newTemporary contents:'content of text file'; yourself) contentType:'text/plain'. smtp := SMTPClient new. smtp connectTo:'exeptn' port:nil user:'info' password:nil. smtp sendMessageString:eMailContentDescription content withSubject:eMailContentDescription subject contentType:eMailContentDescription contentType to:'stefan@exept.de'. smtp close.

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 29 Mar 2024 12:00:22 GMT