Ruby Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

Ruby
Examples

Quick Start
Unicode
Byte Array
Bz2
Certificates
CSV
Email
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT
MIME
POP3
RSA
S/MIME
Signatures
SFTP
SMTP
Socket / SSL
Spider
SSH
SSH Key
SSH Tunnel
Tar
HTTP Upload
XML
XMP
Zip

More Examples...
String
Amazon S3
Email Object
DKIM / DomainKey
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
DH Key Exchange
DSA
LZW

 

 

 

 

 

 

 

Using GMail as your SMTP Server

Downloads for Windows/Linux and Install Instructions

Ruby script showing how to use GMail as your SMTP server for sending email.

# file: Gmail.rb

# Ruby script to send email using the GMail SMTP Server (smtp.gmail.com)

require 'rubygems'
require 'chilkat'

# Create an instance of the mailman object for sending.
mailman = Chilkat::CkMailMan.new()
mailman.UnlockComponent("anything for 30-day trial")

# Set your SMTP server's hostname
mailman.put_SmtpHost("smtp.gmail.com")

# GMail requires a login/password to send mail.
mailman.put_SmtpUsername("gmail_login@gmail.com")
mailman.put_SmtpPassword("gmail_password")

# The GMail uses port 587 and  STARTTLS.
mailman.put_SmtpPort(587)
mailman.put_StartTLS(true)

# Alternatively, you may comment-out the STARTTLS line and instead use SSL
# on port 465 by commenting-in these 2 lines:
#mailman.put_SmtpPort(465)
#mailman.put_SmtpSsl(true)

# Create a simple email
email = Chilkat::CkEmail.new()
email.put_Subject("Sending email using GMail SMTP")
email.put_Body("This email was sent from the GMail SMTP Server")
email.put_From("Chilkat Support <support@chilkatsoft.com>")

# Add a few recipients
email.AddTo("Matt","matt@chilkatsoft.com")
email.AddTo("Somebody","somebody@somewhere.com")

success = mailman.SendEmail(email)
if not success
	mailman.SaveLastError("lastError.xml")
end






 

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