Check out the sample code below to
see just how easy it is to use the SMTP component of
EasyMail Objects. But don't let the ease of use
fool you; the SMTP component is very powerful and
packed with features. The sample code on this page demonstrates the most basic features of
the SMTP component. Be sure to click on the "Other Samples" tab to find
more advanced samples.
| Sample Notes | | This sample demonstrates the basic functionality of the SMTP component that sends a message in plain text with an attachment. |
Set SMTP = CreateObject("EasyMail.SMTP") SMTP.MailServer = "mail.domain.com" SMTP.Subject="Sample Message" SMTP.BodyText = "This is the message." SMTP.FromAddr = "from@domain.com" SMTP.AddRecipient "John Doe","jdoe@domain.com", 1 SMTP.AddAttachment "c:\attachment.doc" SMTP.Send
|