TextBody

Applies to

MimeMessage object

Description

Gets or sets the message body in HTML format, which may link to any LinkedResources.

Usage

In scripts

The TextBody property takes a string value. The following example sends an email using plain-text formatted message body. In this example, you don't need to set the HtmlBody property after the TextBody property is set.

Integer li_rc
SMTPClient  lnv_SmtpClient

lnv_SmtpClient = CREATE SMTPClient

//set the email account information      
lnv_SmtpClient.Host = "smtp.gmail.com"
lnv_SmtpClient.Port = 587
lnv_SmtpClient.Username = "tester001.appeon@gmail.com"
lnv_SmtpClient.password = "Mypassword001"
lnv_SmtpClient.EnableTLS = True

//set the email message
lnv_SmtpClient.Message.SetSender("tester001.appeon@gmail.com","Tester001")
lnv_SmtpClient.Message.AddRecipient("tester002.appeon@gmail.com")
lnv_SmtpClient.Message.Subject = "SMTPClient Test Message"
lnv_SmtpClient.Message.TextBody = "SMTPClient example message body"

//send the email
li_rc = lnv_SmtpClient.Send()

IF li_rc = 1 THEN
 Messagebox('SMTPClient','Mail sent successfully')
ELSE
 Messagebox('SMTPClient' ,'Email sending failed. Return ' + String(li_rc) + '.', StopSign!)
END IF

DESTROY lnv_SmtpClient