Main page
Features, common information
Main principles

  Examples
HTTP connection
Sending email
Low level access

  Download

  Registration

  Methods & properties



Sending email messages examples

Sending simple email message

This code shows the simpliest case of text email
Set tcpip=CreateObject("SHOTIP.Connection")
Set email=tcpip.mail

email.SmtpServer="mailserver.domain.com"
email.To="email@address.com"
email.From="myemail@address.com"
email.Subject="Text subject"
email.Body="Mail body"
email.Send

Specifying full names of recipient and sender

This code shows how to specify full names of recipient and sender
Set tcpip=CreateObject("SHOTIP.Connection")
Set email=tcpip.mail

email.To="John Smit <email@address.com>"
email.From="Roger Taylor <myemail@address.com>"
email.Subject="Text subject"
email.Body="Mail body"
email.Send

Sending email message with attachment

This code shows email attaching Jpeg image
Set tcpip=CreateObject("SHOTIP.Connection")
Set email=tcpip.mail

email.SmtpServer="mailserver.domain.com"
email.To="email@address.com"
email.From="myemail@address.com"
email.Subject="Text subject"
email.AddText "Mail body"
' Attach file using file name
email.AttachFile "c:\filename.jpg"
email.Send

Sending HTML email message

This code shows email attaching Jpeg image
Set tcpip=CreateObject("SHOTIP.Connection")
Set email=tcpip.mail

email.SmtpServer="mailserver.domain.com"
email.To="email@address.com"
email.From="myemail@address.com"
email.Subject="Text subject"
' Specifying email content type
email.Type="text/html"
email.AddText "<BODY><H1>Mail body</H1></BODY>"
email.Send

 ©2001 Mikhail Tchikalov
 mtchikalov@usa.com