You can send a mail with a little code using SMTP. http://en.wikipedia.org/wiki/Simple_Mai ... r_Protocol
You need to setup or find a open relay server, SMTP uses port 25 by default.
So scanning for that may be the fastest. When you find something with a open port 25, try telnetting it.
[telnet mail.test.org 25]
If your lucky you will get something like "220 mail.test.org Microsoft ESMTP MAIL Service ready at Fri, 13 jul 2012 11:17:25 +0200"
You can read more about SMTP running on Exchange, and how to test if it works, here: http://support.microsoft.com/kb/153119
(You dont have to use Exchange to set up a SMTP server, you can find many alternatives.)
You can also try [nmap --script smtp-open-relay mail.test.org/ip-range], but that can take a while.
I dont know what you are making you program in, but google should be be able to assist you with the code.
I can give you a example in C#:
- Code: Select all
MailMessage mailObj = new MailMessage("firstname.lastname@example.org", "email@example.com", "Subject", error.Message.ToString());
SmtpClient SMTPServer = new SmtpClient("mail.test.org");
You can find more information here: http://msdn.microsoft.com/en-us/library ... ssage.aspx
I use this sometimes when i test programs, normally i will have it send me a mail with the error, if an unhandled exception occurres.
Well now i got carried away, so i made something you can take a look at.
I'm using the whatsmyip.com automation ( http://www.whatismyip.com/faq/automation.asp
) to get the ip.
- Code: Select all
static void Main(string args)
private static void SendMail(string sMailBody)
MailMessage mailObj = new MailMessage("firstname.lastname@example.org", "email@example.com", "User IP", sMailBody); //Alte: TO/FROM
SmtpClient SMTPServer = new SmtpClient("SMTP-Server"); //SMTP SERVER, you will have to find this one your selfe
private static IPAddress ExternalIp()
string whatIsMyIp = "http://automation.whatismyip.com/n09230945.asp";
WebClient wc = new WebClient();
UTF8Encoding utf8 = new UTF8Encoding();
string requestHtml = "";
requestHtml = utf8.GetString(wc.DownloadData(whatIsMyIp));
catch (WebException we)
IPAddress externalIp = IPAddress.Parse(requestHtml);
I hope i dont breake your rules by posting this, but i can se many practical and legal uses for it.
Feel free to remove it, no offence intended.
As far as i know it's legal to use open relayes, as long as you dont use them for spam.