Page 7 of 25

Posted: Fri Dec 01, 2006 4:54 pm
by gnozal
Use the PureSMTP_AddHeader() block only one time before PureSMTP_SendMail(). The second time you are sending the headers twice. The server may not like it.

Or use PureSMTP_ClearHeader(), like this :

Code: Select all

...
If PureSMTP_OpenSMTPConnection(MySMTPServer, MySMTPPort) = #PureSMTP_Ok 
            PureSMTP_SetXMailer("Testemail") 
            PureSMTP_SetContentType("text/html; charset=iso-8859-1") 

            PureSMTP_ClearHeader() ; <=============
            PureSMTP_AddHeader("X-MSMail-Priority", "Normal") 
            PureSMTP_AddHeader("Reply-To", "geotrail@gmail.com") 
             
            Head$ = "<html><head><meta http-equiv="+Chr(34)+"Content-Type"+Chr(34)+" content="+Chr(34)+"text/html; charset=UTF-8"+Chr(34)+"><title>Gmail</title></head><body>" 
            Footer$ = "</body></html>" 
            Message$ + Head$ + Msg$ + Footer$ 
             
            Status = PureSMTP_SendMail(Ricipient$, "Robert Olsen <geotrail@start.no>", Subject$, Message$, "") 
            If Status = #PureSMTP_Ok
...
Maybe this solves your problem.

Posted: Fri Dec 01, 2006 5:00 pm
by gnozal
Update Both versions

Changes :
- new function PureSMTP_AddHeader(Header.s, String.s) ; Set additional header strings.
- new function PureSMTP_ClearHeader() ; Clears the additional the header strings.

Posted: Fri Dec 01, 2006 5:03 pm
by GeoTrail
That didn't work, but adding this PureSMTP_CloseSMTPConnection() did hehehe :lol: I added it to the second code but not the first :shock:

Thank you so much for your hard work gnozal. I think I have all your libs for PB4 and use them frequently, specially love PureRESIZE, that makes my life so much easier ;)

Posted: Tue Jan 16, 2007 11:55 pm
by DoubleDutch
Small bug (missing 'feature'?): PureSMTP won't let you send a file attachment that has zero length.

Outlook and TheBat, do...

PurePop3 however will accept and create a zero length file attachment no problem. :)

Also, could there be an option to change the boundary 'pre-text', it seems set to:

PureSMTP_[boundary here]

Posted: Wed Jan 17, 2007 9:15 am
by gnozal
DoubleDutch wrote:Small bug (missing 'feature'?): PureSMTP won't let you send a file attachment that has zero length.
It's a feature.

Code: Select all

InputBufferLength.l = Lof(Stream) ; Attachment length
*InputBuffer = AllocateMemory(InputBufferLength)
If *InputBuffer
  ; Encode attachment
Why would you do that ?
DoubleDutch wrote:Also, could there be an option to change the boundary 'pre-text', it seems set to : PureSMTP_[boundary here]
Will see ...

Posted: Wed Jan 17, 2007 1:03 pm
by DoubleDutch
I wouldn't normally want to send a file of zero length either. My 'automated' system tried... ;)

But, other email systems seem to allow it and PurePop3 will accept and create a zero length file. So I guessed it may have been overlooked with PureSMTP. Thought you may not have noticed.
Also, could there be an option to change the boundary 'pre-text', it seems set to : PureSMTP_[boundary here]
Will see ...
:)

Posted: Wed Jan 17, 2007 2:00 pm
by gnozal
Update (both libs)

Changes :
- new function PureSMTP_SetBoundary()

Posted: Wed Jan 17, 2007 2:06 pm
by DoubleDutch
Thanks (again for the very fast updating) :)

Posted: Thu Jan 18, 2007 4:44 pm
by Flype
hello, first time i use it. it's very useful.

on my dev computer it's ok - every time i send a mail.

but on our server i get this message :
354 Enter mail, end "." on a line by itself
i can see here for example that error 354 is :
http://www.greenend.org.uk/rjk/2000/05/ ... plies.html
354 : Start mail input; end with <CRLF>.<CRLF>

But i don't really understand the problem.

I need some help/experience to point the problem. :idea: :?:

Posted: Thu Jan 18, 2007 5:03 pm
by gnozal
Flype wrote:hello, first time i use it. it's very useful.
on my dev computer it's ok - every time i send a mail.
but on our server i get this message :
354 Enter mail, end "." on a line by itself
The SMTP server sends '354' when it is ready to receive the mail text.
A communication example :
<CONNECT>
RECEIVE : 220 VSMAIL.myserver.local Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at Thu, 18 Jan 2007 16:53:37 +0100

SEND : HELO PureSMTP
RECEIVE : 250 VSMAIL.myserver.local Hello [xxx.xxx.xxx.xxx]

SEND : MAIL FROM: <Gnozal@myserver.fr>
RECEIVE : 250 2.1.0 Gnozal@myserver.fr....Sender OK

SEND : RCPT TO: <Gnozal@myserver.fr>
RECEIVE : 250 2.1.5 Gnozal@myserver.fr

SEND : DATA
RECEIVE : 354 Start mail input; end with <CRLF>.<CRLF>

SEND : From: Gnozal <Gnozal@myserver.fr>
SEND : To: <Gnozal@myserver.fr>
SEND : Date: 05 May 2005 12:00:00

etc...
I don't understand when you get this message ? Does PureSMTP_SendMail() fail and you get this message with PureSMTP_GetLastServerMessage() ?

Posted: Thu Jan 18, 2007 5:05 pm
by Flype
yes i get this message from your last message function.

also - and it is important - the mail is send correctly (i can check it and i really received it).

and i receive #PureSMTP_ServerTimeOut = -6 as a result of the send mail function.

Posted: Thu Jan 18, 2007 5:15 pm
by gnozal
That's strange ...
If the mail is sent correctly and you get the time out error, then the following seems to happen :
1. PureSMTP dialogs with server
2. Server sends 'Start Message' (354)
3. PureSMTP sends the mail text
4. PureSMTP sends 'End of message' (CRLF.CRLF)
5. PureSMTP waits for 'Closing transmission' message (221) from the server
6. PureSMTP doesn't get any answer and quits with #PureSMTP_ServerTimeOut error (and last server message is 354)
Why does the server not answer, I don't know ?

Posted: Thu Jan 18, 2007 5:24 pm
by Flype
Who fix the TimeOut value ?

the server or PureSMTP ?

Posted: Thu Jan 18, 2007 5:27 pm
by Flype
after some test, it works successfully about 2 times on 3.

Posted: Thu Jan 18, 2007 5:28 pm
by gnozal
Flype wrote:Who fix the TimeOut value ?
the server or PureSMTP ?
PureSMTP (default is 5 s, you can change it with PureSMTP_SetTimeOut())