Receiving emails and sending

Just starting out? Need help? Post your questions and find answers here.
oftit
User
User
Posts: 52
Joined: Sun Apr 25, 2010 5:08 am

Receiving emails and sending

Post 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.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: Receiving emails and sending

Post 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.
BERESHEIT
oftit
User
User
Posts: 52
Joined: Sun Apr 25, 2010 5:08 am

Re: Receiving emails and sending

Post 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?
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Re: Receiving emails and sending

Post 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
PB 5.10 Windows 7 x64 SP1
oftit
User
User
Posts: 52
Joined: Sun Apr 25, 2010 5:08 am

Re: Receiving emails and sending

Post 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
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Re: Receiving emails and sending

Post 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
PB 5.10 Windows 7 x64 SP1
oftit
User
User
Posts: 52
Joined: Sun Apr 25, 2010 5:08 am

Re: Receiving emails and sending

Post 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
Barney
User
User
Posts: 54
Joined: Wed Apr 26, 2006 12:01 pm

Re: Receiving emails and sending

Post by Barney »

Hi oftit,

check your mail box.

Barney
oftit
User
User
Posts: 52
Joined: Sun Apr 25, 2010 5:08 am

Re: Receiving emails and sending

Post by oftit »

Thank you very much
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Receiving emails and sending

Post 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.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply