[Gambas-user] SMTP error in Gambas 3.6.0 (rev#6552)
Benoît Minisini
gambas at ...1...
Wed Oct 15 13:54:01 CEST 2014
Le 15/10/2014 13:48, Willy Raets a écrit :
> Hi,
>
> I've been testing smpt on Gambas 3.6.0 (rev#6552).
>
> I use the exact same settings as I do in my mail client Evolution (see
> screenshot smtp-settings-evolution.png), but Gambas smtp fails with
> error:
>
> 'Unable to send mail:Unable to connect to the SMTP server:EHLO command
> failed' (see attached screenshot smtp-error.png)
>
> The form shown on screenshot is part of a Gambas library that user can
> use to set their mail settings so the library can use those settings to
> send me error reports.
>
> The info filled in in the textboxes is stored in Settings and used from
> there in the code below. (see screenshot smtp-settings.png -> I placed
> xxxx on real date for the screenshot, but real info was used for the
> test)
>
> This is the code for the Test button, that tests the connection, but
> returns above error:
>
> Public Sub btnTest_Click()
>
> Dim hMail As New SmtpClient
> Dim sMessage As String
> Dim iL, iE As Integer
> Dim bMailSend As Boolean
> Inc Application.Busy
> Settings.Save
> $bIsChanged = False
> Wait
> hMail.To.Add(Settings["LibGb3DevAid/mailfrom"])
> hMail.From = Settings["LibGb3DevAid/mailfrom"]
> hMail.Host = Settings["LibGb3DevAid/smtp"]
> hMail.Port = Settings["LibGb3DevAid/port"]
> If Settings["LibGb3DevAid/authenticate"] = -1 Then
> hMail.User = Settings["LibGb3DevAid/user"]
> hMail.Password = Settings["LibGb3DevAid/password"]
> Endif
> If Not IsNull(Settings["LibGb3DevAid/encrypt"]) Then
> hMail.Encrypt = Settings["LibGb3DevAid/encrypt"]
> Else
> hMail.Encrypt = 0
> Endif
> hMail.Subject = ("Test connection of your mail settings")
> hMail.Add(Subst(("You have succesfuly send a mail using mail settings
> in application &1."), Local.DefaultAppName))
> hMail.Send
> bMailSend = True
>
> Finally
> Dec Application.Busy
> If bMailSend Then
> sMessage = Subst(("Check you &1 mailbox to see if the test mail
> has been send correctly."), Settings["LibGb3DevAid/mailfrom"])
> Message.Info(sMessage)
> Endif
>
> Catch
> bMailSend = False
> If Len(Error.Text) > 70 Then
> iL = Int(Len(Error.Text) / 2)
> iE = InStr(Error.Text, " ", iL)
> sMessage = Left(Error.Text, iE)
> sMessage &= "\n" & Mid(Error.Text, iE + 1, Len(Error.Text) - iE)
> sMessage &= ("\n\nConnection test failed!!")
> Else
> sMessage = Error.Text & ("\n\nConnection test failed!!")
> Endif
> Message.Info(sMessage)
> Error.Clear
>
> End
>
> It is quite important to me that this works in Gambas 3.6, so I hope it
> can be solved before final 3.6 release.
>
> If needed to help solve the problem I can make a mail address at the
> server for testing purposes.
>
Yes, give me a mail address and send me a project that send a mail that
fails on your computer
And what do you get if you set the Debug property to TRUE?
--
Benoît Minisini
More information about the User
mailing list