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 !"
return
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
mail.AddRecipient(ToEmail.Text)
// send the email
MailSSLSocket.Messages.Append(mail)
// MailProgress.Visible = True
MailSSLSocket.SendMail
InvoiceEmailWin.Close