|
MailListBot Examples - HTML and Plain Text formatted email
|
This example demonstrates the sending of an email with a web page
as the body of the message. NOTE: The images are all reference locations on the web
page. Sending an html email this way requires that the user be connected to the Internet
in order to view the images in the email.
- Create the MailListBot object:
Dim oMailListBot
Set oMailListBot = Server.CreateObject ("ExclamationSoft.MailListBot.3")
If oMailListBot Is Nothing Then
Response.Write "Could not create MailListBot object"
Set oMailListBot = Nothing
Exit Function
End If
- Required Properties:
oMailListBot.SetTo = "email@domain.com"
oMailListBot.SetFrom = "email@domain.com"
oMailListBot.SetServer = "smtp.domain.com"
- Message Body Properties: Set the SetBodyFile parameter to a web page
address, use the SetIsHtmlBody property to tell MailListBot to treat the message body as html,
and use the SetAltBody property to display a text message in email programs not capable of
displaying an html message.
oMailListBot.SetBodyFile = "http://www.yahoo.com"
oMailListBot.SetAltBody = "Please upgrade your email client"
oMailListBot.SetIsHtmlBody = True
- Send the email message:
If oMailListBot.Send = false Then
Response.Write "Failed to send message"
Response.Write "Error message:["&oMailListBot.GetErrorMsg&"]"
Set oMailListBot = Nothing
Exit Function
End If
Set oMailListBot = Nothing
|
|