|
Class: SMTPClient
Object
|
+--NVTClient
|
+--SMTPClient
- Package:
- stx:goodies/communication
- Category:
- Net-Communication-SMTP
- Version:
- rev:
1.23
date: 2018/01/19 22:29:39
- user: cg
- file: SMTPClient.st directory: goodies/communication
- module: stx stc-classLibrary: communication
a very simple SMTP mail client.
Right now, there are two entries:
sendMessageString:
which expects a string argument, containing all of
the mail info (from lines, subject etc.)
sendMessage:
which expects a letter object, which itself is able
to convert itself to a string. At the time of writing,
such a letter object does not exist,
class initialization
-
initialize
-
self initialize.
signal constants
-
smtpErrorSignal
-
accessing
-
clientHostName
-
-
clientHostName: something
-
-
passWord
-
-
passWord: something
-
defaults
-
defaultPassword
-
-
defaultPort
-
Socket portOfService:'smtp'
-
defaultUser
-
operations
-
help
-
send a 'HELP' command to ask about the partners capabilities.
Return a collection of help lines.
-
sendMessage: rfc822Message
-
send an rfc822Message (Net::MailMessage)
-
sendMessage: rfc822Message to: receiver
-
send an rfc822Message
-
sendMessage: rfc822Message toAll: receivers
-
send an rfc822Message
-
sendMessageString: rfc822MessageString to: receiver
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString toAll: receivers
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString contentType: aContentTypString to: receiver
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString contentType: aContentTypString to: receiver cc: ccReceiver bcc: bccReceiver
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString contentType: aContentTypString to: receiver fromLabel: fromLabel
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString contentType: aContentTypeString toAll: receivers
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString contentType: aContentTypeString toAll: receivers fromLabel: fromLabel
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString contentType: aContentTypeString toAll: receivers toAllCc: ccReceivers toAllBcc: bccReceivers
-
-
sendMessageString: rfc822MessageString withSubject: aSubjectString contentType: aContentTypeString toAll: receivers toAllCc: ccReceivers toAllBcc: bccReceivers fromLabel: fromLabel
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString to: receiver
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString to: receiver cc: ccReceiver bcc: bccReceiver
-
send an rfc822MessageString
-
sendMessageString: rfc822MessageString withSubject: aSubjectString toAll: receivers
-
|snmp|
snmp := SMTPClient new.
snmp connectTo:'exept'.
snmp userName:'penk@exept.de'.
snmp sendMessageString:('this is a test message\.\last line' withCRs) withSubject:'Message from SmalltalkX' to:'penk@exept.de'.
snmp close
-
verifyUser: userName
-
|snmp|
snmp := SMTPClient new.
snmp connectTo:'exept'.
Transcript showCR:(snmp verifyUser:'fooUser').
snmp close
private - commands & responses
-
handleReplyCode: lastReplyCode
-
Raise an error if the last response from the SMTP server has an error.
-
sendGoodByeCommand
-
private - connection setup
-
getInitialConnectResponse
-
-
performLoginSequence
-
invoked after the socket connection has been setup
SMTPClient new
userName:'sr';
connectTo:(IPSocketAddress localHost);
sendMessageString:'this is a test message\.\last line' withCRs
to:'stefan.reise@gmx.de';
close.
|
SMTPClient new
userName:'cg';
connectTo:(IPSocketAddress hostName:'exeptn');
sendMessageString:'This is a test message\.\last line' withCRs
withSubject:'testmail'
to:'sr@exeptn';
close.
|
|m|
m := Net::MailMessage new.
m
from:'stefan.reise@exept.de';
to:'stefan.reise@gmx.de';
subject:'Test von stx';
contents:'Dies ist ein mailtext';
yourself.
SMTPClient new
userName:'stefan.reise';
password:'rappel72';
connectTo:(IPSocketAddress hostName:'mail.exept.de');
sendMessage:m;
close.
|
|