It is currently Fri Jan 15, 2021 4:05 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 370 posts ]  Go to page Previous  1 ... 20, 21, 22, 23, 24, 25  Next
Author Message
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 08, 2011 5:22 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
C64 wrote:
Just noticed that if I enable "Create Threadsafe Executable", the single lines causes this:
POLINK: error: Unresolved external symbol '_PB_StringBasePosition'.
Please have a look at the 'Unicode_Thread-safe' topic in PureSMTP.chm : you need to enable a subsystem.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Tue Feb 08, 2011 9:55 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
I did a clean PureBasic install (even deleting the old Prefs files in AppData) and then installed PureSMTP on top, then entered the single line above, and ran it. Below is the result. I don't know what else I can do. Maybe someone else with XP can try these steps and confirm if it happens for them too. If at least one other person confirms it, then I shall be happy, because I'll know it's not just me. :mrgreen:

Image


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Wed Feb 09, 2011 9:14 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
C64 wrote:
I did a clean PureBasic install (even deleting the old Prefs files in AppData) and then installed PureSMTP on top, then entered the single line above, and ran it. Below is the result. I don't know what else I can do.
Here is the code : there is not much that may go wrong.
Code:
ProcedureDLL PureSMTP_AddHeader(Header.s, String.s)
  If Header And String
    AddElement(PureSMTP_Header())
    If LCase(Header) = "reply-to"
      String = GetRealMailFrom(String)
    EndIf
    PureSMTP_Header()\Header = Header
    PureSMTP_Header()\String = String
  EndIf
EndProcedure

The only thing I see is that the linked list may not be initialized. This is done in PB_PureSMTP_Init()
Here is the ASM output :
pbcompiler AddHeaderAlone.pb /commented wrote:
...
PureBasicStart:
...
CALL _SYS_InitString@0
CALL _PB_InitMemory@0
CALL _PB_InitList@0
CALL _PB_InitFile@0
CALL PB_PureSMTP_Init
;
; PureSMTP_AddHeader("X-MSMail-Priority", "High")
PUSH dword _S1
PUSH dword _S2
CALL PB_PureSMTP_AddHeader
...

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Wed Feb 09, 2011 12:19 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
Image

I hope the singlet is enough compensation. :oops: :)


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Sat Mar 12, 2011 7:20 pm 
Offline
User
User
User avatar

Joined: Tue Jun 21, 2005 7:26 pm
Posts: 85
Location: Malta
Hi gnozal,

I'm having some trouble using the bcc parameters. I've set the MailTo parameter to:
Code:
MailTo.s = "****@go.net.mt;bcc:*****1@gmail.com;bcc:*****2@gmail.com"

and this is the data sent to the server ( wireshark )

Code:
220 fender72.go.net.mt ESMTP Exim 4.67 Sat, 12 Mar 2011 18:58:09 +0100
Ehlo PureSMTP
250-fender72.go.net.mt Hello PureSMTP [80.71.106.113]
250-SIZE 15728640
250-PIPELINING
250 HELP
AUTH LOGIN
503 AUTH command used when not advertised
MAIL FROM: <*****@go.net.mt>
250 OK
RCPT TO: <*****@go.net.mt>
250 Accepted
RCPT TO: <*****1@gmail.com>
250 Accepted
RCPT TO: <*****2@gmail.com>
250 Accepted
DATA
354 Enter message, ending with "." on a line by itself
From: <*****@go.net.mt>
To: <*****@go.net.mt>
Bcc: <*****1@gmail.com>
Bcc: <*****2@gmail.com>
Subject: Test (with login authentication)
X-Mailer: PureSMTP
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Testing PureSMTP _ ONLY BCC

.
250 OK id=1PyT4r-0006Il-UT
QUIT
221 fender72.go.net.mt closing connection


All the addresses were visible in the header in Gmail under Bcc. So I went to try it with Outlook to check if it is a server problem but it worked by omitting the bcc from the header.

wireshark
Code:
220 fender70.go.net.mt ESMTP Exim 4.67 Sat, 12 Mar 2011 19:15:26 +0100
EHLO sunlaptop
250-fender70.go.net.mt Hello sunlaptop [80.71.106.113]
250-SIZE 15728640
250-PIPELINING
250 HELP
MAIL FROM: <*****@go.net.mt>
250 OK
RCPT TO: <*****@go.net.mt>
250 Accepted
RCPT TO: <*****2@gmail.com>
250 Accepted
RCPT TO: <*****1@gmail.com>
250 Accepted
DATA
354 Enter message, ending with "." on a line by itself
Message-ID: <001801cbe0e1$774e1360$6402a8c0@sunlaptop>
[b]From: "P2PoE" <*****@go.net.mt>
To: <*****@go.net.mt>
Subject: Test outlook
Date: Sat, 12 Mar 2011 19:15:17 +0100
[/b]MIME-Version: 1.0
Content-Type: multipart/alternative;
.boundary="----=_NextPart_000_0015_01CBE0E9.D2D29910"
X-Priority: 3
X-MSMail-Priority: Normal
....... useless code ..........
.
250 OK id=1PyTLa-0007hT-DZ
QUIT
221 fender70.go.net.mt closing connection


Is there a way to remove the bcc from the header?

Thanks!


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Mon Mar 14, 2011 9:54 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Update (PB4.5x only)

Changes :
- BCC addresses are removed from the header

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


Top
 Profile  
Reply with quote  
 Post subject: PureSMTP library : mail & attachments
PostPosted: Mon Mar 14, 2011 10:00 am 
Offline
User
User

Joined: Tue Dec 08, 2009 7:42 am
Posts: 38
I want to have a background image on an HTML Mail . How can i do ?


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments
PostPosted: Mon Mar 14, 2011 10:31 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
loulou wrote:
I want to have a background image on an HTML Mail . How can i do ?

You probably have to send the message as HTML, but I can't help you further, sorry.

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments
PostPosted: Mon Mar 14, 2011 10:51 am 
Offline
User
User

Joined: Tue Dec 08, 2009 7:42 am
Posts: 38
gnozal wrote:
loulou wrote:
I want to have a background image on an HTML Mail . How can i do ?

You probably have to send the message as HTML, but I can't help you further, sorry.

My problem is how to param Mail Header to have an image attach to the mail


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments
PostPosted: Mon Mar 14, 2011 11:56 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
loulou wrote:
My problem is how to param Mail Header to have an image attach to the mail

Sorry, I don't know.
Include the image as attachment ?

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments
PostPosted: Mon Mar 14, 2011 12:46 pm 
Offline
User
User

Joined: Tue Dec 08, 2009 7:42 am
Posts: 38
gnozal wrote:
loulou wrote:
My problem is how to param Mail Header to have an image attach to the mail

Sorry, I don't know.
Include the image as attachment ?

I want only to have a mail like that
Code:
ontent-Type: multipart/alternative;
boundary="------------040006060302020507070601"

This is a multi-part message in MIME format.
--------------040006060302020507070601
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

  Hi this a message
 

--------------040006060302020507070601
Content-Type: multipart/related;
boundary="------------040308020001050609000802"


--------------040308020001050609000802
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body>
<div align='left'>
<p>Hi this is a message</p>
<a href='http://www.google.com'>
<img src='cid:image1.gif' alt='image1' style='border-style: none;' height='56' width='200'>
<img src='cid:image2.gif' alt='image2' style='border-style: none;' height='56' width='200'>
<br>
</a>
</div>
<u>Hola! á</u>
</body>
</html>

--------------040308020001050609000802
Content-Type: image/gif;
name="image1.gif"
Content-Transfer-Encoding: base64
Content-ID: <image1.gif>
Content-Disposition: inline;
filename="image1.gif"

R0lGODlhyAA4APcAAFoCBCSCbInCtARFK6iEdCdqXMHj3IyuoAQ9KYRCNNjCtIhZXNPz7GCj
kpO9tGISCARbPLyNlKdwZNjO1HojFOzj3FyCdH8uNI9cVKLTycejnARmRKSSiCp4Y5BNTGQY
HJp0dOL19MTSzHEyLM+vtH4UBPzu+DSSfICzpNSypOzq3HcFBr+Eed3FxXclJM27uaLIxOrU
1/f19opORB9oU1KFfoRiXKh9ebGZl7rV1Dt6bMLq4nSmnGCVh8ilpRJeTAROPDRtXZdCOXE2
N38aCejb2MyZmaGDhI+0qw1oVN3t7NrMytK9xHSSjLhuYJxOUPz+/KZlYFQMCKbFvIskG8is
qJA9NkeEcnMdD3gMBeG8uGSbjP<the rest has been removed for clarity>

--------------040308020001050609000802
Content-Type: image/gif;
name="image2.gif"
Content-Transfer-Encoding: base64
Content-ID: <image2.gif>
Content-Disposition: inline;
filename="image2.gif"

R0lGODlhIAFoAdUkAP///wAAAO0gJGdkZKako/JnSTY1NGotI/eXefvJtO84K/7v5/BKM/SA
YfFZPv3WxE5LSh8fHvmvlf3i1VpYV4WCghIREXVycvaMbfijhvN0VUJAPysqKbm3t/q8pJWS
k8zKyuLg4GBgYO/v7////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACQALAAA
AAAgAWgBAAb/QJJwSCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/otHrNbrvf8Lh8
Tq/b7/i8fs/v+/9HIyIBhIWGh4<the rest has been removed for clarity>

--------------040308020001050609000802--

--------------040006060302020507070601--

and i don't know how to program the header with puresmtp library


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments
PostPosted: Mon Mar 14, 2011 1:50 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
loulou wrote:
.....
I want only to have a mail like that
...
and i don't know how to program the header with puresmtp library
PureSMTP.chm ?
Try something like this (partial code):
Code:
Define text.s
Text + "<!DOCTYPE HTML PUBLIC " + #DQUOTE$ + "-//W3C//DTD HTML 4.01 Transitional//EN" + #DQUOTE$ + ">"
text + "<html>"
text + "<head>"
text + "</head>"
text + "<body>"
text + "<div align='left'>"
text + "<p>Hi this is a message</p>"
text + "<a href='http://www.google.com'>"
text + "<img src='cid:image1.gif' alt='image1' style='border-style: none;' height='56' width='200'>"
text + "<img src='cid:image2.gif' alt='image2' style='border-style: none;' height='56' width='200'>"
text + "<br>"
text + "</a>"
text + "</div>"
text + "<u>Hola! á</u>"
text + "</body>"
text + "</html>"
PureSMTP_SetContentType("text/html; charset=iso-8859-1") ; <------ set to HTML
Attachments.s = "c:\your_path\image1.gif;c:\your_path\image2.gif"
...
PureSMTP_SendMail(MailTo, MailFrom, Subject, Text, Attachments)

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


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Mon Mar 14, 2011 6:27 pm 
Offline
User
User
User avatar

Joined: Tue Jun 21, 2005 7:26 pm
Posts: 85
Location: Malta
Thanks for the fix gnozal! :D


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Sun Oct 09, 2011 1:29 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1482
Got some questions, gnozal, regarding sending multiple large files as attachments.

I'm trying to email myself 9 x 1 MB files, but only items 1 to 4 arrive, and then PureSMTP_SendMail() is returning either -3 or -6 error codes. During these 9 attempted sends, PureSMTP_OpenSMTPConnection() is always open, because I'm sending the 9 files in a For/Next loop. Should I be closing the connection between each file instead?

Or, should I be increasing PureSMTP_SetTimeOut() to something larger, like 5 minutes, so each 1 MB email has enough time to go through? Or, both?

Lastly, where does PureSMTP_SetTimeOut() go? Before or after PureSMTP_OpenSMTPConnection()? The docs don't say.

Thanks.

[Edit] Never mind, I worked it out. :) I had to open and close the SMTP connection before and after each part, instead of before and after the loop. Now it works. I also used a timeout of 3600 (one hour) to be sure, after the SMTP connection was opened, and before the send. Hopefully my experience will be of help to someone else in future. 8)

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
Reply with quote  
 Post subject: Re: PureSMTP library : mail & attachments (AUTH supported)
PostPosted: Mon Dec 12, 2011 10:35 pm 
Offline
User
User

Joined: Thu Aug 26, 2004 9:18 pm
Posts: 12
Location: Isere (France)
Hi there !

just to know : is Pure_SMTP lib working on Win7 64 bits ?
On mine, the installer file show me a problem but help file is there... however I can't compile.
I've tried to copy from c:\Program(x86) to c:\Programmes (probably c:\Program files in english but my system is in french). Now it say me "constant not found : #PureSMTP_Ok"

I need to sent email when my program closed (to log error and prevent me that it has stop to works). Help !


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 370 posts ]  Go to page Previous  1 ... 20, 21, 22, 23, 24, 25  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 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