MailSocket Error 102

Hi.
A very wired thing happend happened to me this morning and I will appreciate some suggest.
I have a Web App hosted in ServerWarp working fine for some time.
One functionality was to send an email.
I configure a gmail account.
This morning the application decides to do not send any new email.
I went to the original code, run in debug mode and also from my Mac the application didn´t send mails.
I changed the email account… nothing
I changed the mail provider and use a bluhost email account… same problem
I tried the example XOJO application (EmailSSLExample) and with non account I had conditions to send a single email.
The error that reports was Error 102.
What makes me crazy that nor from the server, from my Mac, with several email account and also using the example XOJO code y solve the problem.
Any idea ???

Error 102 is a disconnect, maybe it never connected.
Gmail has implemented some new features.

Check this out…
https://forum.xojo.com/33583-unable-to-send-emails-from-my-app-via-gmail-account/p2#p275187

I now use Sendgrid

Lennox

I will appreciate any advice to solve this problem. I tried many many ways with no success.
Nor the example XOJO application (EmailSSLExample) is working.
The error that reports was Error 102.

I use SocketLabs to send emails from serverwarp and it works really well…The free account allows enough sends per month, that I’ve never gotten close to the limit…

I am not llooking for an email delivery solution.
I am needing to send mails with XOJO.
I had a web application in production that was running without any problem and sending mails with the following code:

Dim mail As EmailMessage
Dim file As EmailAttachment
Dim i As Integer
Dim s As String

MailSocket.Address = “smtp.gmail.com
'MailSocket.Port = 465
MailSocket.Username = “XXXXXXX@gmail.com
MailSocket.Password = “XXXXXXX”

mail = New EmailMessage
mail.FromAddress ="XXXXXXX@gmail.com"
mail.Subject = “XXXXXX”
mail.BodyPlainText = “XXXXXXX”
mail.BodyHTML = “”
mail.Headers.AppendHeader(“X-Mailer”,“XXXXXX”)

s = ReplaceAll(txtMail.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

MailSocket.Messages.Append(mail)
MailSocket.SendMail

At one moment decided to do not send any new email.
I went to the original code, run in debug mode and also from my Mac the application didn´t send mails.
I changed the email account… nothing
I changed the mail provider and use a bluehost email account… and same problem
I change the internet connection and also de Mac… same problem.
I tried the XOJO example application (EmailSSLExample) and with non account at all I had conditions to send a single email.

The error that reports was Error 102.

[quote=277448:@Mariano Poli]I am not llooking for an email delivery solution.
I am needing to send mails with XOJO.
I had a web application in production that was running without any problem and sending mails with the following code:

Dim mail As EmailMessage
Dim file As EmailAttachment
Dim i As Integer
Dim s As String

MailSocket.Address = “smtp.gmail.com
'MailSocket.Port = 465
MailSocket.Username = “XXXXXXX@gmail.com
MailSocket.Password = “XXXXXXX”

mail = New EmailMessage
mail.FromAddress ="XXXXXXX@gmail.com"
mail.Subject = “XXXXXX”
mail.BodyPlainText = “XXXXXXX”
mail.BodyHTML = “”
mail.Headers.AppendHeader(“X-Mailer”,“XXXXXX”)

s = ReplaceAll(txtMail.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

MailSocket.Messages.Append(mail)
MailSocket.SendMail

At one moment decided to do not send any new email.
I went to the original code, run in debug mode and also from my Mac the application didn´t send mails.
I changed the email account… nothing
I changed the mail provider and use a bluehost email account… and same problem
I change the internet connection and also de Mac… same problem.
I tried the XOJO example application (EmailSSLExample) and with non account at all I had conditions to send a single email.

The error that reports was Error 102.[/quote]
It sounds like Google isn’t allowing that any more. Have you tried another provider?

I too had some problems, but the following snippet solved them:

  if SMTPSock.port = 587 then
    SMTPsock.SMTPConnectionMode = 0
  else
    SMTPsock.SMTPConnectionMode = 1
  end if
 SMTPsock.ConnectionType = //the one you wish: ssl or tls
 SMTPsock.secure = true

BTW: desktop app.

Thanks @Carlo Rubini
With these few lines of code it was solved.

Glad it helped.

Hallo everybody. I have an old version (2013_2) where SMTPConnectionMode (!!!) is not present, and don’t have university resources to buy (rent!) upgrades. Without such instruction to send emails with my students’ test reports is impossible. Any suggestion? any way to build that class? thanks a lot

If the connection mode property is what you need to solve your problem, you could just use a newer version of Xojo to run that app when you need it.