PureSMTP library : mail & attachments (AUTH supported)
Moderator: gnozal
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
akj: can you link to an executable and its source.
Make sure you have the latest PB, the latest Pure_SMTP, AND the libs installed from www.PureBasic.com/beta
I will test it on a machine here that has Windows Me.
It may be a case that somehow your WindowsMe or PureBasic install has been corrupted.
Make sure you have the latest PB, the latest Pure_SMTP, AND the libs installed from www.PureBasic.com/beta
I will test it on a machine here that has Windows Me.
It may be a case that somehow your WindowsMe or PureBasic install has been corrupted.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
The links to your files on your page are going to a search panel at:
http://freenet-homepage.de
[edit]
Its working now...
http://freenet-homepage.de
[edit]
Its working now...

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
The fix for the library works great, thanks! 

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
DoubleDutch:
I do not understand your sentence "can you link to an executable and its source".
I have the latest version of PB and the beta updates installed and both PB and Windows ME are working fine.
I am using PureSMTP version 5.60 but I will retry my program with version 5.70 when I am back on that PC again.
If you could try on your ME machine I would be grateful as I really would like to use the PureSMTP library.
I do not understand your sentence "can you link to an executable and its source".
I have the latest version of PB and the beta updates installed and both PB and Windows ME are working fine.
I am using PureSMTP version 5.60 but I will retry my program with version 5.70 when I am back on that PC again.
If you could try on your ME machine I would be grateful as I really would like to use the PureSMTP library.
Anthony Jordan
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
akj:Do a test program that crashes on your ME system. If you give both the source and the executable, I will compile it as well (thats why we have to be in version sync) and compare the exe's (if yours crashes on my machine and mine does not) - there may be a difference that is resulting in the crash? By link to an executable I mean either PM it me or ftp it somewehre and provide a link to where it is.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I could reproduce the PureSMTP_SetXMailer() crash on Win98SE.
It seems to be some strange PB4/Tailbite memory management issue, because :
- the same code works with PB4 on NT based systems
- the same code works with PB3.94 on NT based systems AND Win95 based systems
I think I found the problem : the string variable initialization in PureSMTP_Init() when the library is loaded.
If I avoid this, there is no crash anymore.
Changes :Could you please test http://freenet-homepage.de/gnozal/PureSMTP_BETA.zip (ANSI PureSMTP beta lib) under Win9x/Me ?
The users with NT based systems too please. If it works, I will update the PB4 library.
It seems to be some strange PB4/Tailbite memory management issue, because :
- the same code works with PB4 on NT based systems
- the same code works with PB3.94 on NT based systems AND Win95 based systems
I think I found the problem : the string variable initialization in PureSMTP_Init() when the library is loaded.
If I avoid this, there is no crash anymore.
Changes :
Code: Select all
ProcedureDLL PureSMTP_Init()
...
; PureSMTP_ContentType = "text/plain; charset=" + #g + "iso-8859-1" + #g
; PureSMTP_XMailer = "PureSMTP"
; PureSMTP_Boundary = "PureSMTP_"
...
EndProcedure
;
Procedure.l PureSMTP_SendMailEx(MailTo.s, MailFrom.s, Subject.s, MsgBody.s, Attachments.s, UserName.s, Password.s, HeaderAddon.s)
...
;
If PureSMTP_XMailer = ""
PureSMTP_XMailer = "PureSMTP"
EndIf
If PureSMTP_ContentType = ""
PureSMTP_ContentType = "text/plain; charset=" + #g + "iso-8859-1" + #g
EndIf
If PureSMTP_Boundary = ""
PureSMTP_Boundary = "PureSMTP_"
EndIf
;
...
EndProcedure
The users with NT based systems too please. If it works, I will update the PB4 library.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
DoubleDutch:
I have sent you the files, as requested, but in the light of Gnozal's last post it is likely that any analysis of the files will now be redundant. Many thanks for offering your help, it is really appreciated.
Gnozal:
The Beta library seems to solve the crashout problems under Windows ME. Deep joy! Thank you.
In summary, these now work correctly:
PureSMTP_SetContentType()
PureSMTP_SetXMailer()
PureSMTP_SetTimeOut() - though I think this has always worked
I have not yet tested these:
PureSMTP_SetBoundary()
PureSMTP_AddHeader()
PureSMTP_ClearHeader()
I have two requests:
1. Minor request: Would it be possible for either the X-Mailer to default to <null> rather than "PureSMTP" or for there to be some [other] way of supressing the X-Mailer line?
2. Major request: I need a way of discovering whether a previously created SMTP connection still exists or whether it been unexpectedly lost so that I need to create another. This is to cover the situation where I am automatically sending an email at regular intervals and it seems a waste of resources to create and close the SMTP connection for every email. So I would like to stay connected for the duration of sending all the emails (perhaps over a period of an hour or more), but have a capability of detecting that the connection has unexpectedly become lost before sending my next email.
[Or would opening a new connection do nothing if the previous connection was still open? This may be an indirect way of resolving my request.]
I have sent you the files, as requested, but in the light of Gnozal's last post it is likely that any analysis of the files will now be redundant. Many thanks for offering your help, it is really appreciated.
Gnozal:
The Beta library seems to solve the crashout problems under Windows ME. Deep joy! Thank you.
In summary, these now work correctly:
PureSMTP_SetContentType()
PureSMTP_SetXMailer()
PureSMTP_SetTimeOut() - though I think this has always worked
I have not yet tested these:
PureSMTP_SetBoundary()
PureSMTP_AddHeader()
PureSMTP_ClearHeader()
I have two requests:
1. Minor request: Would it be possible for either the X-Mailer to default to <null> rather than "PureSMTP" or for there to be some [other] way of supressing the X-Mailer line?
2. Major request: I need a way of discovering whether a previously created SMTP connection still exists or whether it been unexpectedly lost so that I need to create another. This is to cover the situation where I am automatically sending an email at regular intervals and it seems a waste of resources to create and close the SMTP connection for every email. So I would like to stay connected for the duration of sending all the emails (perhaps over a period of an hour or more), but have a capability of detecting that the connection has unexpectedly become lost before sending my next email.
[Or would opening a new connection do nothing if the previous connection was still open? This may be an indirect way of resolving my request.]
Anthony Jordan
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Good news.akj wrote:The Beta library seems to solve the crashout problems under Windows ME. Deep joy! Thank you.
Actually no. What's the problem ?akj wrote:1. Minor request: Would it be possible for either the X-Mailer to default to <null> rather than "PureSMTP" or for there to be some [other] way of supressing the X-Mailer line?
Why don't you just use the sequence PureSMTP_OpenSMTPConnection() / send mail / PureSMTP_CloseSMTPConnection() each time you send mail ?akj wrote:2. Major request: I need a way of discovering whether a previously created SMTP connection still exists or whether it been unexpectedly lost so that I need to create another. This is to cover the situation where I am automatically sending an email at regular intervals and it seems a waste of resources to create and close the SMTP connection for every email. So I would like to stay connected for the duration of sending all the emails (perhaps over a period of an hour or more), but have a capability of detecting that the connection has unexpectedly become lost before sending my next email.
[Or would opening a new connection do nothing if the previous connection was still open? This may be an indirect way of resolving my request.]
Anyway, if you call PureSMTP_OpenSMTPConnection() without having closed the previous connection with PureSMTP_CloseSMTPConnection(), PureSMTP will just keep using current connection.
If the server has disconnected and you try to send some mail, you will get an error, probably #PureSMTP_BadResponse (check PureSMTP_GetLastServerMessage())
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Update (PB4 version only)
Changes :
- fixed a strange PB4/Tailbite memory management issue under Win9x/Me
(crashed functions PureSMTP_ContentType() PureSMTP_XMailer() PureSMTP_Boundary())
Changes :
- fixed a strange PB4/Tailbite memory management issue under Win9x/Me
(crashed functions PureSMTP_ContentType() PureSMTP_XMailer() PureSMTP_Boundary())
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Gnozal wrote:
Is there any chance of you adding that important fact to your documentation for PureSMTP_OpenSMTPConnection() and, if appropriate, for PureSMTP_OpenPOP3ThenSMTPConnection().
This solves my main request. Thank you.If you call PureSMTP_OpenSMTPConnection() without having closed the previous connection with PureSMTP_CloseSMTPConnection(), PureSMTP will just keep using current connection
Is there any chance of you adding that important fact to your documentation for PureSMTP_OpenSMTPConnection() and, if appropriate, for PureSMTP_OpenPOP3ThenSMTPConnection().
Anthony Jordan
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
I will.akj wrote:Is there any chance of you adding that important fact to your documentation for PureSMTP_OpenSMTPConnection() and, if appropriate, for PureSMTP_OpenPOP3ThenSMTPConnection().
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).