Page 1 of 1

Receiving emails and sending

Posted: Mon Nov 15, 2010 3:29 pm
by oftit
Hi all

I've been searching a lot, and can't still figure it out. Iv'e been trying using Gnozal's mail library, but can't get that to work (get a fatal error: Corrupt library: '.\PurePOP3_LIB_NEW_1.lib') and I'm using Gnozal's test-code that was included in the PurePOP3_450.
Anybody knows how to receive emails in other ways?

Now I've been trying to SEND emails, and that doesn't work either. I'm using the code from the Purebasic library:

Code: Select all

;
; ------------------------------------------------------------
;
;   PureBasic - Mail example file
;
;    (c) Fantaisie Software
;
; ------------------------------------------------------------
;

InitNetwork()


If CreateMail(0, "fred@purebasic.com", "Hello !")

  SetMailBody(0, "Hello   "+Chr(10)+"This is a mail !")
  
; This has been deleted:  AddMailAttachment(0, "My description", "brook_3d.png")
; This has been deleted:   AddMailAttachment(0, "My description 2", "test.bmp")
  
  
  AddMailRecipient(0, "test@yourdomain.com", #PB_Mail_To)
; This has been deleted:   AddMailRecipient(0, "test2@yourdomain.com", #PB_Mail_Cc)
  
  Result = SendMail(0, "send.one.com", 2525)
  
  Repeat
    Progress = MailProgress(0)
    Delay(300)
  Until Progress = #PB_Mail_Finished Or Progress = #PB_Mail_Error
  
  If Progress = #PB_Mail_Finished
    MessageRequester("Information", "Mail correctly sent !")
  Else
    MessageRequester("Error", "Can't sent the mail !")
  EndIf
  
EndIf

And still can't send the mail? Anybody knows why?

Thank in advance.

Re: Receiving emails and sending

Posted: Mon Nov 15, 2010 3:32 pm
by netmaestro
If your smtp server requires authentication (some do and some don't) you can't use the Purebasic native library to send as there is no provision for a user/password. This may be your problem, not sure as I know nothing of your email server. Gnozal's library should work either way as he's addressed authentication. Personally, I've never had a moment's trouble with his library.

Re: Receiving emails and sending

Posted: Mon Nov 15, 2010 9:48 pm
by oftit
You might be right. So how do I connect to my smtp server? I guess that I do need user+password, but how?

Any idea of why Gnozal's doesn't work on my machine? Is it because my machine is an x64 bit? Because, there was written something about only x86 bit?

Re: Receiving emails and sending

Posted: Mon Nov 15, 2010 11:29 pm
by jpd
Hi oftit,

Here a link to a really nice Library(Include) POP3/SMTP/E-mail encoder-decoder and much more.
this Include is Written in Purebasic 4.5x and is done for running on Win/LInux 32/64 bit OS, with source code.

Here the Link: AWPB-Tools Includes (eMail/POP3/SMTP/GnuPG/ZIP ...) written by cptdark!

Best
jpd

Re: Receiving emails and sending

Posted: Tue Nov 16, 2010 10:35 am
by oftit
Hi jpg
I can not read german :(. And I tried to download the .zip file, but the website wouldn't let me download it, it said something about the .zip file is not good for me?

Thank you

Re: Receiving emails and sending

Posted: Tue Nov 16, 2010 10:49 am
by jpd
Hi oftit,

yes sorry the description is in German but the include and the sample is written in PB. :)
here the direct link to zip file AWPBTools-0_1.zip

Re: Receiving emails and sending

Posted: Tue Nov 16, 2010 10:57 am
by oftit
Hi jpd

I still can't download it? Im sorry am I doing something wrong? Do you have skype? Maybe you can send it from there? Or send it to my e-mail oftit2@gmail.com

Re: Receiving emails and sending

Posted: Tue Nov 16, 2010 1:51 pm
by Barney
Hi oftit,

check your mail box.

Barney

Re: Receiving emails and sending

Posted: Tue Nov 16, 2010 3:29 pm
by oftit
Thank you very much

Re: Receiving emails and sending

Posted: Tue Nov 16, 2010 4:58 pm
by IdeasVacuum
I hope I'm wrong but you may hit the same issues with Ronny's lib. If you do, it might have something to do with either your firewall, your anti-virus or of course your email server settings.