It is currently Thu May 23, 2013 2:59 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 355 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23, 24  Next
Author Message
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Fri Dec 31, 2010 11:34 am 
Offline
User
User

Joined: Tue Dec 08, 2009 7:42 am
Posts: 23
Can you developed a version in which html mail will be possible ?


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Fri Dec 31, 2010 11:43 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
loulou wrote:
Can you developed a version in which html mail will be possible ?
I do not know any SMTP command to handle the outbox.

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


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Fri Dec 31, 2010 12:09 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
It may be handy to have a function to send RAW commands to the SMTP server and get the RAW reply (on the current PureSMTP connection)? Possible the same for the PurePop3 library too?
(I wish Fred would add this to his FTP and Mail libraries)

_________________
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: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Fri Dec 31, 2010 12:23 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
DoubleDutch wrote:
It may be handy to have a function to send RAW commands to the SMTP server and get the RAW reply (on the current PureSMTP connection)? Possible the same for the PurePop3 library too?

Sending some user defined text is not a problem.
But how to handle the server answer ? It maybe a short text, megabytes of data, or an error message.
This is handled by a message loop in PureSMTP.

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


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Fri Dec 31, 2010 12:40 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
I see what you mean, maybe specify a timeout in the send command - all data captured in an expanding memory buffer until that time has passed since last data reply? It could default to 1/2 second? The memory address would be the return parameter?

eg:
Code:
reply=PureSMTP_RawSend(command$[,timeout])
if reply
.
.
.
   FreeMemory(reply)
endif

This way other users can add commands that may be missing (they may only be on certain servers and not part of the official SMTP spec?) and submit them to you for 'offical' inclusion (if you like)?

_________________
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: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Fri Dec 31, 2010 12:57 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
I will try to think of something usable.

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


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Thu Jan 27, 2011 1:32 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
Is PureSMTP_SetContentType() meant to remember its setting after PureSMTP_CloseSMTPConnection() is called? Because once I set the content type to "text/html" and send an email, and close the connection, the next email sent is also "text/html" instead of the default of "text/plain". I would've thought the default would be used whenever PureSMTP_OpenSMTPConnection() is called?

Basically, I currently have to do this with my program:

Code:
;monospaced is a global variable depending on how I want to send.

If PureSMTP_OpenSMTPConnection(...)=#PureSMTP_Ok
  If monospaced=1
    PureSMTP_SetContentType("text/plain; charset=iso-8859-1")
  Else
    PureSMTP_SetContentType("text/html; charset=iso-8859-1")
  EndIf
  result=PureSMTP_SendMail(...)
  PureSMTP_CloseSMTPConnection()
EndIf


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Thu Jan 27, 2011 2:24 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
C64 wrote:
Is PureSMTP_SetContentType() meant to remember its setting after PureSMTP_CloseSMTPConnection() is called?

Yes, like PureSMTP_SetXMailer() and PureSMTP_SetBoundary().
Set the value to "" to reset to default value.

I have updated the help file.

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


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 01, 2011 1:58 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
Thank you. Another question (for you or any lurkers): I can easily send image attachments with PureSMTP, but what about sending an HTML email with the image embedded? I know I'd have to compose the email body with HTML tags, but I'm unsure of how I'd get the image data in there. Base64 I assume, with boundaries? Am I close? Can someone post some theory so I can do the practice? Thanks again.


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 08, 2011 2:19 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
Found a bug (I think) in PureSMTP today, when trying to use PureSMTP_AddHeader(). Reproducible code follows (without my data). Example taken from the PureSMTP help file. Using PureBasic 4.51 and the latest PureSMTP library, on XP (32-bit). Turning the Purifier on gives a different address in the error message, rather than 0. Changing the addresses in MailTo and MailFrom doesn't fix the error.

Code:
Line: 12 - Invalid memory access. (write error at address 0)

Code:
MySMTPServer.s = "MySMTPServer"
MySMTPPort.l = 25
If PureSMTP_OpenSMTPConnection(MySMTPServer, MySMTPPort) = #PureSMTP_Ok
  Debug PureSMTP_GetLastServerMessage()
  MailTo.s = "whoever@you.want"
  MailFrom.s = "root@127.0.0.1"
  Subject.s = "Test"
  MsgBody.s = "Testing PureSMTP"
  Attachments.s = ""
  ;Username.s = "TEST"
  ;Password.s = "TEST"
  PureSMTP_AddHeader("X-MSMail-Priority", "High")
  ; sending mail
  Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody)
  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


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 08, 2011 4:05 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
C64 wrote:
Found a bug (I think) in PureSMTP today, when trying to use PureSMTP_AddHeader(). Reproducible code follows (without my data). Example taken from the PureSMTP help file. Using PureBasic 4.51 and the latest PureSMTP library, on XP (32-bit). Turning the Purifier on gives a different address in the error message, rather than 0. Changing the addresses in MailTo and MailFrom doesn't fix the error.
Sorry, I can't reproduce the issue : the mail is sent with high priority as expected.
No debugger error.
No purifier alert.
No crash.
PB4.51 / XP sp3 x86

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


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 08, 2011 4:14 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
I noticed I also get the exact same crash with just one line in the IDE like this (compile/run it):

Code:
PureSMTP_AddHeader("X-MSMail-Priority", "High")

What does this do on your PC?


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 08, 2011 4:16 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
C64 wrote:
I noticed I also get the exact same crash with just one line in the IDE like this (compile/run it):
Code:
PureSMTP_AddHeader("X-MSMail-Priority", "High")

What does this do on your PC?
Nothing.
Note : this function just adds an element to a linked list in the library.

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


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 08, 2011 4:52 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
With the Purifier enabled, the single line compiles and runs fine. Disabled, it crashes. Just musing out loud.

[Update] Just noticed that if I enable "Create Threadsafe Executable", the single lines causes this:

Code:
---------------------------
PureBasic - Linker error
---------------------------
POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
POLINK: fatal error: 1 unresolved external(s).
---------------------------
OK
---------------------------


Top
 Profile  
 
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 08, 2011 5:18 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
You should do a reinstall of purebasic and the extra libs - it works fine on mine.

_________________
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  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 355 posts ]  Go to page Previous  1 ... 19, 20, 21, 22, 23, 24  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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