wodSmtp ActiveX Control - SendTextHtmlAttachment Method
      
 

Description

Creates and sends multipart message with attachment.


Return Type

None  


Syntax

object.SendTextHtmlAttachment From, To, Subject, PlainText, HTMLText, Attachment



The SendTextHtmlAttachment Method syntax has these parts:

Part Description
object An expression evaluating to an object of type wodSmtp.
From Required. A String value. Specifies sender of the message.
To Required. A String value. Specifies recipient of the message.
Subject Required. A String value. Specifies message subject.
PlainText Required. A String value. Holds text/plain part of the message.
HTMLText Required. A String value. Holds text/html part of the message.
Attachment Required. A String value. Holds full path to the attachment.

Remarks

SendTextHtmlAttachment method is a one-line-command that can be used in your applications to send email, with none of extra work. You can use this command immediately after you initialize wodSmtp. Message will be sent until it's delivered, or until RetryCount expires. Unlike SendTextHtml method, this method can also send attachments.

No other commands needs to be set for this method to work - except property DNSHostname must not be empty! It is auto-filled by your network settings information when wodSmtp is initialized, but in case wodSmtp is unable to determine your Nameserver IP - you might need to fill it by yourself.

If you want to send more than one attachment, you should use CreateTextHtmlAttachment method, and then add as many attachments as you want using Message.Attach method. Once you're done, just call SendMessage method to deliver the message.

If you haven't already Connected to the server using Connect method, SendTextHtmlAttachment will establish the connection for you, and in that case it will automatically call Disconnect method to after the message is delivered. If Connect method was manually called, wodSmtp will not disconnect, so you can call Reset method and send new message to the same server.