Delphi Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
DH Key Exchange
DSA
Email
Email Object
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
NTLM
POP3
RSA
S/MIME
SMTP
Socket
Spider
SFTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Byte Array
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

Type Conversion

 

Article: Understanding COM References in Delphi

SMTP Authentication

Download Chilkat Email ActiveX

Discusses SMTP authentication in the Delphi programming language using the Chilkat email component.

{
  This sample code discusses SMTP authentication.

  When calling SendEmail, the Chilkat email component connects to the SMTP server,
  authenticates, sends an email, and disconnects.  Upon connecting, SendEmail initiates
  the SMTP protocol by sending a HELO (or EHLO) message.  The SMTP server's response
  indicates, among other things, what authentication methods it is willing to accept.
  The default behavior is for Chilkat to automatically select the most secure authentication
  method and authenticate in that way.  Chilkat supports NTLM, CRAM-MD5, LOGIN, and PLAIN.
  If you wish to force a particular authentication method, you may set the mailman's
  SmtpAuthMethod property equal to one of the strings: "NTLM", "CRAM-MD5", "LOGIN", or "PLAIN".

  If you are sending email over SSL, or are using STARTTLS, the LOGIN auth method is OK to
  use because the authentication process will take place on an encrypted channel anyway.
}
procedure TForm1.Button9Click(Sender: TObject);
var
  email: IChilkatEmail2;
  ok: Integer;

begin
  // A ChilkatMailMan2 ActiveX component was dropped onto the Delphi
  // form, and this became the Form's member variable "ChilkatMailMan21".

  ChilkatMailMan21.UnlockComponent('Anything for 30-day trial');
  ChilkatMailMan21.SmtpHost := 'smtp.comcast.net';

  // If our SMTP server requires authentication, set the username/password.
  ChilkatMailMan21.SmtpUsername := 'myUsername';
  ChilkatMailMan21.SmtpPassword := 'myPassword';

  // By default, the Chilkat e-mail component will choose the most secure
  // authentication method available as indicated by the SMTP server.
  // If you find you are having trouble, you can force the authentication
  // method to one that always works:  "LOGIN"
  // Normally, you do not need to set SmtpAuthMethod.
  ChilkatMailMan21.SmtpAuthMethod := 'LOGIN';

  email := ChilkatMailMan21.NewEmail();
  email.Subject := 'Email sent from a Delphi program!';
  email.From := 'Chilkat Support <support@chilkatsoft.com>';
  email.AddTo('Chilkat Admin','admin@chilkatsoft.com');
  email.Body := 'This email was mailed from a Delphi program...';

  // Connect to the SMTP server and send the email.
  ok := ChilkatMailMan21.SendEmail(email);
  if (ok = 0) then
        ChilkatMailMan21.SaveLastError('errorLog.xml');

end;



 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · XML Parser