Hi,
I do not understand well what mean mail.bodyHTML:
Do I must put an HTML code or Xojo provide to format the HTML text?
And how the encoding text to work?
Because I try to send email with the email example
introducing an HTML page and work correctly but the encoding of text do not match
and , , etc. do not match and become not correct!
Thank for help!
Example code of e-mail send message
[code] Dim mail As emailMessage
Dim file As emailAttachment
Dim i As Integer
Dim s As String
// set up the socket
MailSocket.Address = ServerField.Text
MailSocket.Port = 25
If authenticateBox.Value = True Then
MailSocket.Username = UserNameField.Text
MailSocket.Password = PasswordField.Text
Else
MailSocket.Username = “”
End If
// populate the email message
mail = New emailMessage
mail.FromAddress = fromAddressFld.text
mail.Subject = subjectFld.text
mail.BodyPlainText = BodyField.text
mail.BodyHTML = htmlFld.text
mail.Headers.AppendHeader(“X-Mailer”,“Xojo SMTP Demo”)
// add recipients
s = ReplaceAll(ToAddressFld.Text, “,”, Chr(13))
s = ReplaceAll(s, Chr(13)+Chr(10), Chr(13))
For i = 1 To CountFields(s, Chr(13))
mail.AddRecipient(Trim(NthField(s, Chr(13), i)))
Next
// add cc recipients
s = ReplaceAll(ccAddressFld.Text, “,”, Chr(13))
s = ReplaceAll(s, Chr(13)+Chr(10), Chr(13))
For i = 1 To CountFields(s, Chr(13))
mail.AddCCRecipient(Trim(NthField(s, Chr(13), i)))
Next
// add attachments
If fileFld.Text <> “” Then
file = New emailAttachment
file.LoadFromFile(GetFolderItem(fileFld.Text))
mail.Attachments.Append(file)
End If
// send the email
MailSocket.Messages.Append(mail)
MailProgress.Visible = True
MailSocket.SendMail[/code]