E-mailer

Blitz3D Forums/Blitz3D Programming/E-mailer

Nike(Posted 2009) [#1]
Ok so i need to build a simple emailer. I would like it to send e-mails with powerpoint's attached to it. It will be called powerpoint. Also needs to have a subjet. No need for a body tho. It logs into a gmail and sends attachment to another gmail. Help me please. Thanks.


Kryzon(Posted 2009) [#2]
Sounds more like a pizza order to me.

PS: That subject is out of my league, can't help you, sorry.


GIB3D(Posted 2009) [#3]
I don't understand people who only post to say they can't help :|
In your case, you didn't, you said something else first. But if everyone started posting to say they know nothing, the internet would explode.

Btw: I have no idea how to do that in Blitz3D either.


Nike(Posted 2009) [#4]
Ok well thanks for atleast posting. I can only find 3 e-mail codes and none of them work so i was hoping to find someone with some "easy to understand" code. thanks anyway.


Kryzon(Posted 2009) [#5]
Where are these 3 e-mail codes, Nike? perhaps we can work from them.


GfK(Posted 2009) [#6]
I don't understand people who only post to say they can't help :|... ...if everyone started posting to say they know nothing, the internet would explode.

Btw: I have no idea how to do that in Blitz3D either.


Are you trying to blow up the internet, or what?


Ross C(Posted 2009) [#7]
That's quite an asking there. If you paid someone to do this, they'd probably charge you at least £100.

Any reason why you can't just use an existing email client for this?


Adam Novagen(Posted 2009) [#8]
Are you trying to blow up the internet, or what?

YES!!! Interne-xplosion!!! Wheehee!!!

...

... Yeaaaahhh, maybe I better not talk like that... Too many hackers around these days, and someone might take my words to heart. XD

Nike, I would say this: I'm no expert, but email is WAY out of the normal Blitz league. Not impossible, just highly difficult. As far as I'm aware, email isn't even really standardized; I think different service providers use different protocols & such. I would agree with Ross C here; just use an existing email client.

If, however, you're completely hell-bent on doing this email thing (in which case more power to you!) I say go have a look on Wikipedia. Search for "email", see what you get, and work from there.


GIB3D(Posted 2009) [#9]
Haha here's a fun(ny) idea. Code your own internet in Blitz3D, the Operating System too, and then add in the Email program. lol


Nike(Posted 2009) [#10]
the three e-mailers i found are below.

http://www.blitzbasic.com/codearcs/codearcs.php?code=20
http://www.blitzbasic.com/codearcs/codearcs.php?code=23
http://www.blitzbasic.com/codearcs/codearcs.php?code=1494

This is going to be ment for my school because some people there need help getting on google. I offered to make one and i will get paid if i do. I tried making one with those codes but i can't do it.


Nike(Posted 2009) [#11]
here is one more i found

http://www.blitzbasic.com/codearcs/codearcs.php?code=1263


Zethrax(Posted 2009) [#12]
Here's one for BlitzMax. You could probably adapt it to work with Blitz3D easily enough.

http://www.blitzbasic.com/codearcs/codearcs.php?code=2165

To add attachments, you'll need to create a multipart mime email. Below is a Google search query with info on doing this.

http://www.google.com/search?hl=en&client=opera&rls=en&hs=gj&ei=6RgZSoCoN8iTkAXLjI3kDA&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=php+email+attachment+multipart+mime&spell=1


Kryzon(Posted 2009) [#13]
t=OpenTCPStream( "smtp.yourisphere",25 ) ; establishes a reliable connection to the server. The 25 is the SMTP port, very important.

If Not t RuntimeError( "Error connecting" )
WriteLine t,"HELO BlitzMail"
WriteLine t,"MAIL FROM:<bob@...;"
WriteLine t,"RCPT TO:<alice@...;"  
WriteLine t,"DATA"
WriteLine t,"Hello there Alice!"
WriteLine t,"This is from Blitz Mail!"
WriteLine t,""
WriteLine t,"."
WriteLine t,"QUIT"
Print "Done. Press any key..." : WaitKey

It's the SMTP Protocol, used throught the web to send e-mails. You will need to get a bit of info regarding the server you would be using to send your email, as such is necessary specifying when you send the message.
Note that in the "MAIL FROM", the address ends with a ";". Disregard that, because it's this website that adds it. It should only be "<email>".

You can read a bit more here (and find other links to other sources):
http://email.about.com/cs/standards/a/smtp.htm
http://en.wikipedia.org/wiki/SMTP

Pretty much that's what the capitalized words mean, in that code sample. They are the SMTP codes that give the server a bit of info on what to do with the message. The HELO (or EHLO) would greet the server, and so forth. Learn about SMTP and Blitz network commands, and you'll have your email sender in no time.


Ross C(Posted 2009) [#14]
You wouldn't be trying to help circumvent a protection measure for a school internet system?


Nike(Posted 2009) [#15]
What do you mean ross?


Nate the Great(Posted 2009) [#16]
This is going to be ment for my school because some people there need help getting on google.


they block google at your school?


Nike(Posted 2009) [#17]
ok i tried to turn the bmax code into blitz3d code. here is what i got

Global from_mail$ = "test1@..."
Global from_name$ = "bob"
Global to_mail$ = "test2@..."
Global to_name$ = "george"
Global email_subject$ = "From MaxMail"
Global email_message$ = "HI"
Global email_mailhost$ = "smtp.gmail.com"
Global email_mailport = 25

Print "Connecting..."
Global mailsocket = OpenTCPStream(email_mailhost$,25)
Print "Socket connected!"
Global t = mailsocket

Global msg = ""


msg = ReadLine (t) 
Print msg

WriteLine t,"HELO MaxMailer"
msg = ReadLine(t) 
Print msg

WriteLine t,"MAIL FROM: <" + from_mail + ">"
msg = ReadLine (t) 
Print msg

WriteLine t,"RCPT TO: <" + to_mail + ">"
msg = ReadLine (t) 
Print msg

WriteLine t,"DATA"
msg = ReadLine (t) 
Print msg

WriteLine t,"Date: " + CurrentDate
WriteLine t,"From: " + from_name + " <" + from_mail + ">"
WriteLine t,"To: " + to_name + " <" + to_mail + ">"
WriteLine t,"Subject: " + email_subject
WriteLine t,""

WriteLine t,email_message 

WriteLine t,""
WriteLine t,""
WriteLine t,"."
msg = ReadLine (t) 
Print msg

WriteLine t,"QUIT"
msg = ReadLine (t) 
Print msg

CloseTCPStream t

Print "Mailed!"
End


it is still not working tho. (i edited out my email address)


Nike(Posted 2009) [#18]
No, some people at my school are at a preschool level with computers. I helped 2 people save a powerpoint and 3 how to send a msg on gmail.


Nike(Posted 2009) [#19]
GIA_Green_Fire_, thats a great idea! I am going to try to make an operating system! If anyone wants to help post in this forum and i will make a new forum called operating system. This would be really cool to atleast try to make. and if its made, we, the creators can sell it and make millions! I am willing to split the profits made if anyone will help.


AJ00200(Posted 2009) [#20]
Ill help, but havs NO IDEA where to start.
(Killing thebinternet, 1 comment at a time)
We could make our own Linux Varient that runs raw BB3D code!


Nike(Posted 2009) [#21]
ok
I will make a big fourm with the idea