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

Username:   Password: 
 RegisterRegister   
 Sending an E-mail
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Prince Pwn




PostPosted: Tue Apr 05, 2011 3:07 pm   Post subject: Sending an E-mail

Here's how to send an e-mail from any address, to any address. Just modify the variables to your liking. Chances are the e-mail will get sent into the recipient's spam folder. You will also need a local SMTP server or one that's unencrypted, or you will need to use authentication but if you chose the latter only be able to send from your actual address. I'm using QK SMTP Server full version. This program also writes to a file for personal debugging purposes, I was pasting in CMD for verification.

Turing:

View.Set ("text")

const ip := "localhost"
const port := "25"
const fromEmail := "admin@google.ca"
const toEmail := "princepwn@hotmail.info"
var speed : int := 10                           % minimum speed of 3
var command : array 1 .. * of string := init (
    "telnet " + ip + " " + port,
    "helo " + ip,
    "mail from:" + fromEmail,
    "rcpt to:" + toEmail,
    "data",
    "From: " + fromEmail,
    "To: " + toEmail,
    "SUBJECT: Re: Turing Email",
    "You just recieved an email using Turing",
    "This probably arrived in your spambox",
    "I like turtles",
    "\n.\nQUIT"
    )

var netStream := Net.OpenConnection (ip, strint (port))
var fileStream : int
open : fileStream, "Email.log", put, mod
if (netStream <= 0) then
    put "Unable to connect\nPlease start your SMTP Server"
else
    for i : 1 .. upper (command)
        delay (speed)
        put command (i)
        put : netStream, command (i)
        put : fileStream, command (i)
    end for
end if
close : fileStream
close : netStream
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Tue Apr 05, 2011 5:33 pm   Post subject: RE:Sending an E-mail

It seems a bit odd to have the telnet line in there. Why not connect directly to the SMTP server?

Also the "helo" part of the protocol is meant to identify the client not the server (should be the clients hostname/ip and not the servers).
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
goroyoshi




PostPosted: Tue Apr 05, 2011 7:06 pm   Post subject: RE:Sending an E-mail

update, how long does it take for the email to get there because i'm using my gmail account as smtp server and trying to send the message to myself
Prince Pwn




PostPosted: Wed Apr 06, 2011 2:08 pm   Post subject: RE:Sending an E-mail

No idea on how do do smtp without telnet.
helo is identifying the client to the server, isn't it?

The emails arrive instantly. Make sure you view the log of your smtp server software.

One thing to watch out for is your ports. I had trouble doing this outside my LAN until I change from port 25.
goroyoshi




PostPosted: Wed Apr 06, 2011 5:20 pm   Post subject: Re: RE:Sending an E-mail

Prince Pwn @ Wed Apr 06, 2011 2:08 pm wrote:
No idea on how do do smtp without telnet.
helo is identifying the client to the server, isn't it?

The emails arrive instantly. Make sure you view the log of your smtp server software.

One thing to watch out for is your ports. I had trouble doing this outside my LAN until I change from port 25.


prince go to google and search how to use gmail account as an smtp server
Prince Pwn




PostPosted: Thu Apr 07, 2011 6:53 am   Post subject: RE:Sending an E-mail

It only works with authentication if you use a gmail w/ smtp Very Happy
goroyoshi




PostPosted: Thu Apr 07, 2011 6:31 pm   Post subject: RE:Sending an E-mail

ya i realized the problem, i need admin to unblock turing

you should be able to use gmail, its easier than other methods

also i got gmail to run with a different port and ip
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 7 Posts ]
Jump to:   


Style:  
Search: