[No Bug] SendMail() PB 5.4x (forgot to install libcurl)

Linux specific forum
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

[No Bug] SendMail() PB 5.4x (forgot to install libcurl)

Post by infratec »

Hi,

now SendMail() does not crash in thread
http://www.purebasic.fr/english/viewtop ... 23&t=62636

But now it is not working with or without thread.
And also on Debian 7 x64.

Still the same program for testing:

Code: Select all

EnableExplicit

Procedure Send(*Dummy)
 
  Protected.i Mail
  Protected Alarm$
 
  Mail = CreateMail(#PB_Any, "supervisor@smarthome.ednt.de", "Test")
  If Mail
    PrintN("created")
    Alarm$ = "That's the main body"
    PrintN("before SetMailBody")
    SetMailBody(Mail, Alarm$)
    PrintN("after SetMailBody")
    AddMailRecipient(Mail, "root@localhost", #PB_Mail_To)
    PrintN("after AddMailRecipient")
    If SendMail(Mail, "127.0.0.1")
      PrintN("success")
    Else
      PrintN("failed")
    EndIf
  EndIf
 
EndProcedure



Define.i Thread

InitNetwork()

OpenConsole()

PrintN("Called normal:")

Send(0)

PrintN("")
PrintN("Now as thread:")

Thread = CreateThread(@Send(), 0)
WaitThread(Thread)
It shows now always failed.

It works without problems with PB 5.31 x64

Bernd
Last edited by infratec on Thu Dec 17, 2015 9:56 am, edited 1 time in total.
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Again SendMail() PB 5.40 x64 and 5.41B3 x64

Post by Fred »

Did you install libcurl ?
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Again SendMail() PB 5.40 x64 and 5.41B3 x64

Post by infratec »

Hi,

no :oops:

But I'd checked the dependecies with ldd and this didn't show libcurl.
And since I didn't use something with ssl I thought it should work.

I'll test it immediately.

Bernd
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Again SendMail() PB 5.40 x64 and 5.41B3 x64

Post by Fred »

We load libcurl dynamically (dlopen()) that's why ldd tells nothing.
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: [No Bug] SendMail() PB 5.4x (forgot to install libcurl)

Post by infratec »

Working!

Thread header changed accordingly.
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: [No Bug] SendMail() PB 5.4x (forgot to install libcurl)

Post by infratec »

Maybe it will be a good idea to note this in the help file.
Or a message should be raised when the loading of the lib fails.
Last edited by infratec on Thu Dec 17, 2015 9:59 am, edited 2 times in total.
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [No Bug] SendMail() PB 5.4x (forgot to install libcurl)

Post by Fred »

I will add a note in the doc to mention it, as it's not obvious.
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: [No Bug] SendMail() PB 5.4x (forgot to install libcurl)

Post by infratec »

A message in syslog or a message on stderr (if loading fails) would be better, since an application is often used on an other PC than the development.
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: [No Bug] SendMail() PB 5.4x (forgot to install libcurl)

Post by Fred »

infratec wrote:A message in syslog or a message on stderr (if loading fails) would be better, since an application is often used on an other PC than the development.
Seems fair, added for the next version (and added to the doc as well).
Post Reply