Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Turing and "NET" (emails)
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
TokenHerbz




PostPosted: Tue Jan 25, 2011 5:10 pm   Post subject: Turing and "NET" (emails)

I know it's possible to look up web pages, even create a chat program or a connection over the internet.

But is there a way that i could send an email using Turing (For non Malicious Reasons).

I'm interested in knowing how it works, and why it wont work (which ever applies) and the concepts behind them.
Sponsor
Sponsor
Sponsor
sponsor
ProgrammingFun




PostPosted: Tue Jan 25, 2011 5:19 pm   Post subject: RE:Turing and "NET" (emails)

Why would you want to use Turing? It will lag way too much...
Do you mean accessing an HTML based email (Gmail, Hotmail, Yahoo!) or a program such as Outlook?
2goto1




PostPosted: Tue Jan 25, 2011 5:21 pm   Post subject: RE:Turing and "NET" (emails)

I'd speculate that it would work perfectly fine if you launch a command line process using Sys.Exec, http://compsci.ca/holtsoft/doc/sys_exec.html. You could invoke a send mail script (that you would have to write, using any programming language or scripting language of your choice). That's one way to do it in case Turing doesn't have the capability built-in.
DemonWasp




PostPosted: Tue Jan 25, 2011 5:27 pm   Post subject: RE:Turing and "NET" (emails)

Since Turing supports network streams, you can implement (some of): POP3, SMTP, IMAP. All of these protocols can be used for mail, among several others. Basically, you're going to end up sending messages by put-ing text through a TCP stream, then get-ing the server's responses and interpreting them.

Turing does not have a built-in email library. Few languages do, I suspect.
2goto1




PostPosted: Tue Jan 25, 2011 5:36 pm   Post subject: RE:Turing and "NET" (emails)

Most enterprise-friendly languages have a built-in library to send emalis. I.e. Java, http://www.tutorialspoint.com/java/java_sending_email.htm, .NET, http://weblogs.asp.net/scottgu/archive/2005/12/10/432854.aspx, PHP, http://email.about.com/od/emailprogrammingtips/qt/How_to_Send_Email_from_a_PHP_Script.htm, etc.

Granted, a lot of the APIs that are native to those languages don't necessarily support everything that you could by writing your own SMTP session exchange at the TCP API level...that gives you total flexibility.
TokenHerbz




PostPosted: Tue Jan 25, 2011 5:41 pm   Post subject: RE:Turing and "NET" (emails)

well to send a message to my friends hotmail address, is what i was aiming for.

2onego1: your link in 1st post is broken //infact all are broken
Tony




PostPosted: Tue Jan 25, 2011 5:53 pm   Post subject: RE:Turing and "NET" (emails)

Except that if you are running your own mail server, email deliverability turns out to be a _difficult_ problem. This is why companies like MailChimp can charge up to $0.03 (much cheaper at volume) per email that they send out on your behalf.

edit: 2onego1's links incorrectly include trailing commas.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
TokenHerbz




PostPosted: Tue Jan 25, 2011 5:59 pm   Post subject: RE:Turing and "NET" (emails)

Could someone assist me with the SMTP? seems to be what im looking for. Do i have to script this with something else outside of turing, or since turing can use NET i can probly do it with turing?
Sponsor
Sponsor
Sponsor
sponsor
TokenHerbz




PostPosted: Tue Jan 25, 2011 6:00 pm   Post subject: RE:Turing and "NET" (emails)

I dont want to run a server, I jsut want for example, "Hey there" -> it sends that "HEY THERE" to his hotmail address. No need to recall etc. just sending info to hotmail adress.
Tony




PostPosted: Tue Jan 25, 2011 6:08 pm   Post subject: RE:Turing and "NET" (emails)

You need a server. If you don't want to run one locally, you can connect to a remote one via POP3/SMTP/IMAP (depending on what a remote server supports).
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
TokenHerbz




PostPosted: Tue Jan 25, 2011 6:11 pm   Post subject: RE:Turing and "NET" (emails)

okay how would we go about using simple mail transfer protocal?

I don't understand how we can use an IP to send the email to a SPECIFIC email adress. IP is the web site, not the actual mail recipiant to that web site.
2goto1




PostPosted: Tue Jan 25, 2011 6:13 pm   Post subject: Re: RE:Turing and "NET" (emails)

TokenHerbz @ Tue Jan 25, 2011 5:41 pm wrote:
well to send a message to my friends hotmail address, is what i was aiming for.

2onego1: your link in 1st post is broken //infact all are broken


The compsci forum software encoded a comma at the end of each of my links. The commas were meant to separate the links from one another, I'll have to keep that in mind next time. Just copy & paste the links, and remove the trailing comma for them to work
Tony




PostPosted: Tue Jan 25, 2011 6:16 pm   Post subject: RE:Turing and "NET" (emails)

Not quite, TCP/IP includes an address (IP) of a machine on a network, and a port number. That machine could be running many services, commonly a webserver (port 80 for HTTP traffic, which is almost always omitted for convenience, but implicitly is still there as a silent default) or a mail server or a game server, etc.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
2goto1




PostPosted: Tue Jan 25, 2011 6:21 pm   Post subject: Re: Turing and "NET" (emails)

If you have a Google account, you can send email through it. I've done that on numerous occasions for testing purposes. Here's a sample of doing that (links should be working, I've tested that my punctuation isn't getting in the way):

http://stackoverflow.com/questions/757987/send-email-via-c-through-google-apps-account

If you want to write the SMTP communication yourself, you can do so. Try using a telnet session and create a simple SMTP hello world session, i.e.

http://hanez.org/howto-telnet-smtp.html

Once you're able to do that, you just have to take the commands that you've used in the telnet session, and program them with the Turing network APIs.
TokenHerbz




PostPosted: Tue Jan 25, 2011 6:39 pm   Post subject: RE:Turing and "NET" (emails)

Turing:

var SMTP_port : int := 25
var stream : int
var HOST_ADDRESS : string := Net.HostAddressFromName("www.hotmail.com")
stream := Net.OpenConnection(HOST_ADDRESS,SMTP_port)
if stream <= 0 then
    put "NO GO!"
end if
put ""
put "CONNECTED TO ", HOST_ADDRESS
put ""
%%so we connected to hotmail? now we sent it info ??
%%makes no sense but lets try it anyways,,

put : stream, "HELO local.domain"
delay(5000)  %%should be suffice enough time to get reply no?
if Net.LineAvailable (stream) then
    var line : string
    get : stream, line : *
    put line
end if
%%SHOULD GET A REPLAY FROM SERVER?!?


I'm not understanding this i'm pretty sure... because this makes no sense, but these examples and info i have aren't great.

Could someone explain better then those web sites?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 28 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: