Usage Samples

Some examples of configuration files and scripts with notes on what they do.

Important: It is essential to have the DNS record for any domain set up correctly, before you can use the gateway. If you are part of a university or company network, you should perhaps contact your it department so they can set this up for you. If you are doing it under your own steam there are very many domain registrars which have a control panel that gives you complete control of your domain. You need to set up a standard A Record for the ip address of the computer running the computer, and then an MX Record for each to the email domains you wish to handle on the computer running the gateway.

XML Configuration

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE webmailconfig SYSTEM "config.dtd">
	<topleveldomain match="">
		<user match="*" href=""/>
	<topleveldomain match="">
		<user match="*" href=""/>
	<topleveldomain match="">
		<user match="*" href=""/>

This basic sample is similar to the configuration which distributes with version 0.05 pre alpha version of smtp2http. It is well formed XML compliant to the config.dtd file. This configuration file demonstrates using the smtp to http request gatway to handle the email from 3 different domains and post the mail each domain to a different php page. The program emulates a mime encoded form post from a browser, so its not necessary to have PHP installed on the server, any mechanism that understands these kinds of posts will work.

PHP Scripts

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<title>SMTP2HTTP Test Page</title>

This page should not be called directly. It is for receiving requests from
More Details at <a href=""></a><br>

$message="From: ".$from."\nTo: ".$to."\nSubject: ".$subject."\nHeader: "
 .$header."\nBody: "

mail($from, "Re: ".$subject." (".$tousername.")", $message,
     "From: webmaster@$SERVER_NAME\r\n"
    ."Reply-To: ".$to."\r\n"
    ."X-Mailer: PHP/" . phpversion());	

This script just sends the message back to the originator, first changing the subject line a little.

ASP Scripts

Coming Soon

JSP Scripts

Coming Soon

Thanks to SourceForge Logo for providing source code development and hosting facilities