PureSMTP library : mail & attachments (AUTH supported)

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:I changed the #CR$ to #CRLF$ throughtout the body of the email and it appears to work ok now - I don't know is this is a problem with your lib or the fax server system?
I do not have any experience with a fax system, but with SMTP as far as I know, each message sent to the server must be terminated with CRLF and not CR.
RFC 821 - 4.1.2. COMMAND SYNTAX wrote:... The commands consist of a command code followed by an argument field. Command codes are four alphabetic characters. Upper and lower case alphabetic characters are to be treated identically. Thus, any of the following may represent the mail command:

MAIL Mail mail MaIl mAIl

This also applies to any symbols representing parameter values, such as "TO" or "to" for the forward-path. Command codes and the argument fields are separated by one or more spaces. However, within the reverse-path and forward-path arguments case is important. In particular, in some hosts the user "smith" is different from the user "Smith".

The argument field consists of a variable length character string ending with the character sequence <CRLF>. The receiver is to take no action until this sequence is received...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

gummel wrote:...
i try to send a mail to a majordomo-mailiglist.
...
Could it be that das "<>" around the mailadresses ist the reason.
..
I've no trouble with this syntax before, but majordomo seems to have a spezial behavior.
...
Is it possible to correct the syntax?
As far as I know, the "<" and ">" brackets are mandatory in SMTP, so I will not change that.
rfc2821 - 3.3 Mail Transactions wrote:...
The first step in the procedure is the MAIL command.

MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF>

This command tells the SMTP-receiver that a new mail transaction is
starting and to reset all its state tables and buffers, including any
recipients or mail data. The <reverse-path> portion of the first or
only argument contains the source mailbox (between "<" and ">"
brackets)
, ...

The second step in the procedure is the RCPT command.

RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF>

The first or only argument to this command includes a forward-path
(normally a mailbox and domain, always surrounded by "<" and ">"
brackets
) identifying one recipient.
...
That said, the problem could be the X-Mailer. I don't know Majordomo, but some anti-spam filters reject an 'unknown' X-Mailer.
Try to change it with PureSMTP_SetXMailer().
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gummel
User
User
Posts: 11
Joined: Sat Mar 22, 2008 11:26 am

Post by gummel »

Sorry for the post!

Gnozal useses and produces a correct code! It was my fault, because I used an old snippet with a double entry of the "FROM"-field in the header.

Majordomo accept the mails without any problem!

Thanks Gnozal!
Amnesty
User
User
Posts: 54
Joined: Wed Jul 04, 2007 4:34 pm
Location: Germany

Post by Amnesty »

Hi Gnozal,

can you please fix it for the beta 5. I ve got a Polink compiler error.

Thank you in advance.

Amnesty
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Amnesty wrote:can you please fix it for the beta 5. I ve got a Polink compiler error.
When I have some time, I will update my libs for beta 5 (they will be updated for PB4.20 final, but I may not have the time to update for every new beta).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

ok, no problem. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

(PB 4.2x version only)

Changes :
- recompiled with PB 4.20 beta 6
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Hello

I receive this response:


SMTP error from remote mail server after end of data:
host mail.ukonline.co.uk [212.135.6.8]: 550 No From and/or Date header given


I guess it was the Date header the one missing.

Did it has to have some special "valid" format?

Or just
PureSMTP_AddHeader("Date", FormatDate("Y=%yyyy, M= %mm, D=%dd", Date()))
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

I tried

PureSMTP_AddHeader("Date", FormatDate("Y=%yyyy, M= %mm, D=%dd", Date()))

And the server seems to feel fine about that because i dont receive any more advise, looks like the email reach the destination.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

I am glad you solved the problem.
AFAIK, the 'Date' header is not mandatory in SMTP.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update (PB4.20 version only)

Changes
Recompiled for PB4.20 final with 'exported string function fix'

See this thread for more information : http://www.purebasic.fr/english/viewtop ... 0&start=18
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Amnesty
User
User
Posts: 54
Joined: Wed Jul 04, 2007 4:34 pm
Location: Germany

Post by Amnesty »

Hi Gnozal,

I ve got an error when I try to compile thread-safe.

Unresolved external symbol 'PB_StringBasePosition'

I ve got the newest version from 27.05.2008 PB 4.20.

Regards

Amnesty
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Amnesty wrote:I ve got an error when I try to compile thread-safe.
Unresolved external symbol 'PB_StringBasePosition'
I ve got the newest version from 27.05.2008 PB 4.20.
Works as expected here, using PB4.20 final and jaPBe.
If you are using the PB IDE, don't forget to enable the 'UserLibThreadSafe' subsystem when compiling in threadsafe mode (it's automatic in jaPBe).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Amnesty
User
User
Posts: 54
Joined: Wed Jul 04, 2007 4:34 pm
Location: Germany

Post by Amnesty »

Yes, I m working with the PB IDE.

How can I activate this subsystem ? Is it a command or checkbox ?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Amnesty wrote:Yes, I m working with the PB IDE.
How can I activate this subsystem ? Is it a command or checkbox ?
Main menu -> Compiler -> Compiler options -> Library subsystem
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply