[Gambas-user] SMTP error in Gambas 3.6.0 (rev#6552)

Willy Raets willy at ...2734...
Wed Oct 15 14:28:03 CEST 2014


On wo, 2014-10-15 at 13:54 +0200, Benoît Minisini wrote:
> 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

I have made a simplified test project where you can replicate the
problem. I used the original form and code from my library and threw out
all unneeded controls and code.

I did test it again and error remains the same, so seems I have
replicated the problem in the attached project.

I will now make you a mail address on the mail server and send you all
details in a private mail.
> 
> And what do you get if you set the Debug property to TRUE?
> 

Forgot to try :(

-- 
Kind regards,

Willy (aka gbWilly)

http://gambasshowcase.org/
http://howtogambas.org
http://gambos.org



-------------- next part --------------
A non-text attachment was scrubbed...
Name: MailTester-0.0.1.tar.gz
Type: application/x-compressed-tar
Size: 6436 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20141015/c6333246/attachment.bin>


More information about the User mailing list