NoteVisualWorksSendEmail

mailTheFileToIntendedRecipients

        | mm smtp text | 
        text := self ws contents .
        mm := Net.MailMessage new .
        mm contentType: 'text/html' .
        mm to: 'Rtm-DBConsis' .
        mm from: 'sattlert ' .
        mm subject: 'Daily Database Consistency Checks' .
        mm text: text .
        smtp := Net.SimpleSMTPClient new .
        smtp username: 'sattlert' .
        smtp hostName: 'localhost' .
        smtp sendMessage: mm .

New SMTP client

smtpClient := SMTPClient host: 'smtp.cincom.com'.

smtpClient user: (NetUser username: 'username' password: 'password' ).
smtpClient connect.

[
    smtpClient login.
    smtpClient send: message1.
    smtpClient send: message2.
] ensure: [smtpClient close ]

Or:

client := SMTPClient new.

client user: (NetUser username: 'username' password: 'password').
client hostName: 'smtp.com' portNumber: '9090'.
client useSecureConnection.

[ client connect ] on: Security.X509.SSLBadCertificate do: [ :ex | ex proceed].
[client send: self message]  ensure: [smtpClient close ]

last edited 2007-03-16 13:45:31 by FrankMueller