[Gambas-user] Sending mails "solved"

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue Aug 13 08:25:01 CEST 2013



Am 12.08.2013 18:35, schrieb Benoît Minisini:
> Le 12/08/2013 18:28, Rolf-Werner Eilert a écrit :
>> Hi folks,
>>
>> just FYI, for you were so nice to try to get me up with the Gambas SMTP
>> client:
>>
>> Finally, I picked up a discussion Benoit had had with someone else some
>> time ago that it's tricky to really implement authorisation here. Then I
>> remembered another discussion in some forum about a similar thing. So I
>> searched again and found a script named "sendEmail" written in Perl
>> which is easily doing the job.
>>
>> It hasn't been updated since 2009, but it's running out of the box, so I
>> simply use a Shell command to let it send the mails the way I wanted.
>>
>> For Benoit this could be a template to complete his SMTP in Gambas. It's
>> well commented, you can find it at
>> http://caspian.dotconf.net/menu/Software/SendEmail/
>>
>> Regards
>>
>> Rolf
>>
>
> SmtpClient supports SSL and TLS authorisation. What was not working?
>

Well... it simply didn't send the mails, or more specific: the mails 
never arrived anywhere, and I couldn't make out any error messages 
anywhere. The only message I got was the ending "-> quit". During my 
holidays, it might have been caused by a bad internet connection, but it 
wouldn't run here either.

Maybe you remember, you told me to look in the "standard errors", but I 
didn't find anything at /var/log...

Then this weekend I found a discussion from last year or so you had had 
with someone on the SMTP topic, and it turned out you could not find a 
way to complete programming. In the documentation it says "not 
everything is supported yet". So I looked for another way of 
implementing it.

Here is my test project which was intended to be included into the 
bigger main project once it had been running. My personal data have been 
changed:

Public Sub Main()
Dim t$ As String
Dim email As New SmtpClient

   t$ = File.Load(Application.Path &/ "test.pdf")

   With email
     .Add("This is the mail text")
     .Add(t$, mime.Binary, "test.pdf")
     .To.Add("eilert-sprachen at ...221...")
     .From = "myname at ...20..."
     .Subject = "Ein Test"
     .Encrypt = Net.SSL
     .Port = 587
     .Host = "smtp.web.de"
     .User = "username"
     .Password = "password"
     .Debug = True
   End With

   Try email.Send

   If Error Then
     Print Error.Text
     Print Error.Where
   Endif

End


I tried this with my yahoo account and t-online account (= German 
Telecom), sending mails forth and back, but to no avail.

When I tried sendEmail giving it the same data, the mail was sent at once.

Rolf




More information about the User mailing list