Trying to send the email 6 times to myself but it only emailed once.
I know that it disconnect after sending…Is there anyway to reconnect and email again for a few times depending on my Do…Loop?
Dim i As Integer
Do Until i = 5
msgbox "This is message " + str(i)
//***************************************************
SendMailSocket.Address = "SMTP Email Server" // your SMTP email server
SendMailSocket.Port = 587 // Check your server for the property port # to use
SendMailSocket.Username = "SMTP USERNAME"
SendMailSocket.Password = "SMTP PWD"
// Create the actual email message
Dim mail As New EmailMessage
mail.FromAddress = "test@yourdomain.com"
mail.Subject = "Test Email from Xojo" + str(i)
mail.BodyPlainText = "Hello, World!"
mail.Headers.AppendHeader("X-Mailer", "Xojo SMTP Example") // Sample header
mail.Headers.AppendHeader("Received", "Xojo SMTP Example") // Sample header
mail.Headers.AppendHeader("Message-Id", "Test@test.com")
mail.AddRecipient("info@honjofudousan.com")
// Add the message to the SMTPSocket and send it
SendMailSocket.Messages.Append(mail)
SendMailSocket.SendMail
//***************************************************
i = i + 1
Thank your the reply.
Actually, I have a list of email addresses of friends and would like to email out to them with the same content but with a little personalized touch.
Wants the program to read the list from a listbox and send email to each of them directly.