Email sent via socket gets sent to spam

I am sending emails to customer via - a socket ( code is below ) all works well except, usually the emails get sent to spam - vs if i send by a client the emails do not get put in to the cusotmer’s spam folder.
Is there a method or property that will mimic an email client ?

please advise

email socket code - works great but gets sent to spam …

if ToEmail.Text = "" Then
  MsgBox "Warnng No To Email Address Specified !"
end if

// set up the socket
MailSSLSocket.Address = Server.Text
MailSSLSocket.Port = Val(Port.text)
MailSSLSocket.ConnectionType = SMTPSecureSocket.TLSv1
MailSSLSocket.SMTPConnectionMode = SMTPSecureSocket.ModeSSLTLS
MailSSLSocket.Secure = True

MailSSLSocket.Username = UserName.Text
MailSSLSocket.Password = Password.Text

// look up DB info
Dim cusName, cusAddress As String
Dim MesBody As String

// LoadCusID(ToEmail.Text, cusName, cusAddress)
cusName = MainWin.CusName.Text
cusAddress = MainWin.CusAddress.Text

// populate the email message
mail.FromAddress = FromEmail.Text
mail.Subject = Subject.Text

MesBody  = Replace(Message.Text, "{NAME}", "Customer")
MesBody = Replace(MesBody, "{SERVICE_ADDRESS}", cusAddress)

mail.BodyPlainText = MesBody
//mail.BodyHTML = htmlFld.Text
mail.Headers.AppendHeader("X-Mailer","Demo SMTP Cullins Service")

// save last email send
MainWin.SaveText.Text = ToEmail.Text

// add recipients

// send the email
// MailProgress.Visible = True


Well, spam is a decision made on the server.
Depends on what content you have.

Compare the email you send to how it would look like when you make it in the email client.
I assume your email misses some extras, e.g. like names on the sender/receiver.

Use a sender like MailGun, SendGrid, or my personal favorite, Postmark. Make sure SPF, DMARC, and DKIM are all setup correctly. Thanks to no security at all on email when it was created, it’s a lawless nightmare out there. You’ll never get a good spam score using your own server these days.

got it - makes perfect sense, i was really not aware.

Christian -
wow - MBS is jam packed with email options, trying it now, never knew this before.

Or the email client at the remote end.

when i send an email via a client, the email goes though, when i use xojo socket methods, the email will usually go to spam.