It is currently Fri May 24, 2013 4:44 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 355 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12 ... 24  Next
Author Message
 Post subject:
PostPosted: Sat Jan 27, 2007 3:21 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Jul 22, 2003 5:02 pm
Posts: 1496
Location: Nantes, France
Frontier wrote:
I've tried PureSMTP_SetContentType("multipart/mixed; charset=iso-8859-7")


maybe this way :

PureSMTP_SetContentType("text/plain; charset=iso-8859-7")

_________________
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 27, 2007 4:10 pm 
Offline
User
User

Joined: Thu Dec 22, 2005 2:43 pm
Posts: 64
Location: Chios, Greece
Flype wrote:
Frontier wrote:
I've tried PureSMTP_SetContentType("multipart/mixed; charset=iso-8859-7")


maybe this way :

PureSMTP_SetContentType("text/plain; charset=iso-8859-7")


It worked :D
I thought I could not use the "text/plain" content type class, because my message was in Unicode Greek; seems the SMTP server was smart enough not to destroy the message.

Thank you very much for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 27, 2007 8:52 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 09, 2003 10:08 pm
Posts: 635
Location: Nottingham
I have never been able to get PureSMTP_SetXMailer() working for PureSMTP versions 5.20 to 5.60. It always gives an error [reported by the PB debugger] of "Invalid memory access".

The code line I am trying to get working (after establishing a valid SMTP connection) is:
Code:
PureSMTP_SetXMailer("LockOff")

If it is relevant, I am using Windows ME and PB 4.02 .

Gnozal, could you please check for the possibility of a bug in your coding of PureSMTP_SetXMailer() ?

_________________
Anthony Jordan


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 27, 2007 9:18 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Jul 22, 2003 5:02 pm
Posts: 1496
Location: Nantes, France
@frontier
Cool. PureSMTP_SetContentType("text/plain; charset=iso-8859-1") for french language works for me so i guessed it should also works for your language :wink:

@akj
PureSMTP_SetXMailer("myprogram") works for me on XP SP2.
So it should be a bug related to Windows ME.

_________________
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 27, 2007 11:07 pm 
Offline
User
User

Joined: Thu Dec 22, 2005 2:43 pm
Posts: 64
Location: Chios, Greece
Indeed, PureSMTP_SetXMailer works for me also on both Windows Server 2003 x64 and Windows XP Pro SP2 (Tablet PC edition).


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 28, 2007 9:39 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 09, 2003 10:08 pm
Posts: 635
Location: Nottingham
When I do a run-time trap of the error message generated by PureSMTP_SetXMailer() on my Windows ME computer I get:

Error code = $C0000005
Message = Access Violation of a Virtual Address Read from address $FFFFFFFF

Does anyone know a cure for the above error?

Unfortunately I also get the same error with PureSMTP_SetContentType() thus rendering PureSMTP virtually useless to me as I wish to send HTML emails.

Is it possible to get hold of a version of the PureSMTP library where content type text/html is the default rather than text/plain ?

_________________
Anthony Jordan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 9:33 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
All I can say is PureSMTP_SetXMailer() also works with Windows NT4. Could not test it with Win98SE.

I can't see why it shouldn't work, it's a one line code !
Code:
Global ..., PureSMTP_XMailer.s, ...

ProcedureDLL PureSMTP_Init()
  ...
  PureSMTP_XMailer = "PureSMTP"
  ...
EndProcedure

ProcedureDLL PureSMTP_SetXMailer(XMailer.s) ; Set X-Mailer [Default is "PureSMTP"]
  PureSMTP_XMailer = XMailer
EndProcedure

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 11:36 am 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
akj: Have you tried completely powering off your machine then turning it back on and trying again.

I have had some really strange problems with the latest version of PB, they are fixed once I turn off and restart the machine. I haven't been able to isolate what is the cause at present. Next time it happens I am going to build an assembly 'source' version, restart and then compare the two.

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 6:58 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
There seems to be a problem with PureSMTP and running a network server...

With this code, the client can connect to the server - but no data can be transfered. Comment out the PureSMTP code and it works fine.

Code:
If InitNetwork() = 0
  MessageRequester("Error", "Can't initialize the network !", 0)
  End
EndIf

Port = 6832
Buffer = AllocateMemory(1000)

If CreateNetworkServer(0, Port)
  MessageRequester("PureBasic - Server", "Server created (Port "+Str(Port)+").", 0)
 
; ******

MySMTPServer.s = "MySMTPServer"
MySMTPPort.l = 25
If PureSMTP_OpenSMTPConnection(MySMTPServer, MySMTPPort) = #PureSMTP_Ok
  Debug PureSMTP_GetLastServerMessage()
  MailTo.s = "MyName@MyServer"
  MailFrom.s = "PureSMTP@testing"
  Subject.s = "Test (with login authentication)"
  MsgBody.s = "Testing PureSMTP"
  Attachments.s = ""
  UserName.s = "TEST"
  Password.s = "TEST"
  ; sending mail
  Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName, Password)
  If Status = #PureSMTP_Ok
    Debug "Message : sent"
    Debug "Status = " + Str(Status)
  Else
    Debug "Message : something went wrong !"
    Debug "Status = " + Str(Status)
    Debug PureSMTP_GetLastServerMessage()
  EndIf
  PureSMTP_CloseSMTPConnection()
Else
  Debug "OpenSMTPConnection failed"
  Debug PureSMTP_GetLastServerMessage()
EndIf

; ******
 
   ConnectionID = OpenNetworkConnection("127.0.0.1", Port)
   If ConnectionID
     MessageRequester("PureBasic - Client", "Client connected to server...", 0)
     SendNetworkString(ConnectionID, "An hello from a client !!! :-)")
     MessageRequester("PureBasic - Client", "A string has been sent to the server, please check it before quit...", 0)
     CloseNetworkConnection(ConnectionID)
   Else
     MessageRequester("PureBasic - Client", "Can't find the server (Is it launched ?).", 0)
   EndIf
 
  Repeat
    SEvent = NetworkServerEvent()
    If SEvent
      ClientID = EventClient()
      Select SEvent
        Case 1
          MessageRequester("PureBasic - Server", "A new client has connected !", 0)
 
        Case 2
          MessageRequester("PureBasic - Server", "Client "+Str(ClientID)+" has send a packet !", 0)
          ReceiveNetworkData(ClientID, Buffer, 1000)
          MessageRequester("Info", "String: "+PeekS(Buffer), 0)
 
        Case 4
          MessageRequester("PureBasic - Server", "Client "+Str(ClientID)+" has closed the connexion...", 0)
          Quit = 1
   
      EndSelect
    EndIf
   
  Until Quit = 1
 
  MessageRequester("PureBasic - Server", "Click to quit the server.", 0)
  CloseNetworkServer(0)
Else
  MessageRequester("Error", "Can't create the server (port in use ?).", 0)
EndIf
End

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 29, 2007 8:16 pm 
Offline
Always Here
Always Here
User avatar

Joined: Sat Aug 30, 2003 5:58 pm
Posts: 5892
Location: Denmark
Confirmed!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 9:31 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
DoubleDutch wrote:
There seems to be a problem with PureSMTP and running a network server...

With this code, the client can connect to the server - but no data can be transfered. Comment out the PureSMTP code and it works fine.

You are right.

I have found the problem.
The library uses InitNetwork() before calling OpenNetworkConnection().
So with your code, InitNetwork() is called twice. If I remove InitNetwork() in PureSMTP, it works fine.

How to be sure that InitNetwork() has been called if I remove it from the library ?

EDIT : I could also move InitNetwork() to PureSMTP_Init(), so it is only called one and in your code just don't call InitNetwork() when you use the library.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Last edited by gnozal on Tue Jan 30, 2007 10:40 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 10:40 am 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
I think that this is something that Fred should sort out.

Maybe there should be an internal 'virgin' flag associated with the Init... commands so they will be bypassed if they are called twice.

You fix the problem temporarily you could add a flag that could be set with an advanced command.

eg:
Code:
PureSMTP_SkipInitNetwork(#True)  ; defaults to false on library init


also, don't forget...

Code:
PurePOP3_SkipInitNetwork(#True) ; defaults to false on library init


:)

I've posted it to suggestions:

http://www.purebasic.fr/english/viewtop ... 161#180161

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Last edited by DoubleDutch on Tue Jan 30, 2007 10:45 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 10:44 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
DoubleDutch wrote:
I think that this is something that Fred should sort out.

What do you think of this : I could also move InitNetwork() to PureSMTP_Init(), so it is only called once and in your code just don't call InitNetwork() when you use the library. So it works.

Hum, bad idea ...It would not work if you use PureSMTP and PurePOP3 together ...
I will use your flag idea.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 11:08 am 
Offline
Enthusiast
Enthusiast

Joined: Mon Jun 09, 2003 10:08 pm
Posts: 635
Location: Nottingham
DoubleDutch:

Following your suggestion, I have tried running my program (as an .EXE file) immediately after cold-booting my PC but I still get the same error message of "Access Violation of a Virtual Address Read from address $FFFFFFFF".

I am now resigned to not being able to fully use Gnozal's package for my particular application requirements. Does anyone know of any other PureBasic SMTP package that will allow me to easily send emails in HTML format?

_________________
Anthony Jordan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 11:27 am 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
That should work.

When does PureSMTP_Init() get called?

Is it called with the first Pure_SMTP command, or when the program that includes a Pure_SMTP itself is initialised?

[EDIT]

This doesn't matter if your using the flag idea... :)

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Last edited by DoubleDutch on Tue Jan 30, 2007 11:33 am, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 355 posts ]  Go to page Previous  1 ... 6, 7, 8, 9, 10, 11, 12 ... 24  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye