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.18 date: 2021/04/09 17:58:05
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
    

copyright

COPYRIGHT (c) 2010 by eXept Software AG All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:56:27 GMT