X-Mailer, this php3 script verifies recipient address in three different ways before it sends
email. All in one document.
Supports CC, BCC, Reply-to and Soon Attached files.
Gives a full report of the transaction when finished.
Easily customizable, feel free to morph it to your needs.
The script can be downloaded from this address :
http://www.1st-home.net/Computers/legang/xmailer.zip
tobozo@biosys.net
Here is the code :
<?
// X-mailer for PHP3
// Excuse my french, but English is not my native language.
// Okay, I wrote this script, but 60% is copy/pasted/modified from others.
// Finished 29-10-99 By Tobozo tobozo@biosys.net from pieces of scripts
// found everywhere on the internet :
// http://www.dells.com/ , http://www.tuna.org , http://www.phpwizard.net
// http://www.php.net etc etc etc
// The ValidateEmail function is used, thanx to Jon S. Stevens jon@clearink.com
// and Shane Y. Gibson shane@tuna.org for that part.
// The JavaScript code for email syntax verification is from phpwizard.net (validator)
// Thanx to Tobias Ratschiller (never spoke to him but thanx anyway).
// Actually the script doesnt verify the CC, BCC, and FROM fields
// because it sometimes gives a timeout... could work on it.
// The attached files are not sent (not event in the code hehehe).
// Whoever wants to modify this is welcome (dont forget to send me
// the updated version).
//
// Todo
//
// Implement BCC, FROM and CC verification by using frames
//
// Implement attached files and Embedded HTML tags
//
// Implement a list to provide a header choice in the messages
// (possibly to "lie" on the mail client-version
//
// Your ideas
//
// you are free to copy/modify/spread this code as long as you keed the credits
// to the contributors (list is getting bigger).
// Enhancements ideas, updates, insults, send email to : tobozo@biosys.net
//
// USE but dont ABUSE
// Uncomment this line and put the full URL of your document if you
// get problems with the script.
<p align=justify><font color=yellow size=+2><B>X-mailer-z no-(c) The savate<BR>
<font size=-1 face=tahoma>The purpose of this PHP3 Script is to send anonymous
(no so much in fact) email using the sendmail of the web server. It verifies if the recipient
exists by connecting on the smtp and performing a HELO/RCPT TO:. If answer is 250, mail is
sent. If not .. . who knows ?
</td><td bgcolor=000000>
if (!$mailfrom)
{
echo "sender field empty !";
exit;
}
if (!$mailto)
{
echo "recipient field empty !";
exit;
}
if (!$subject)
{
echo "subject field empty !";
exit;
}
if (!$msg)
{
echo "message field empty !";
exit;
}
if ($mail)
{
$val_results = array( "", "" );
$val_results = validateEmail( $mailto );
if ( $val_results[0] == true )
{
$value = "<font color=\"green\"><B>valid !</b></font>";
$commentaire = "<BR><B>Conclusion : <BR>Mail was probably sent (who
knows).</b>";
}
else
{
$value = "<font color=\"red\"><B>invalid !</b></font>";
$commentaire = "<BR><B>Conclusion : <BR>Invalid email can be
explained by many things and doesnt mean the email was not sent : <BR><li>Smtp could be
down<li>Smtp is behind a firewall<li>This server could allow sendmail but not socks<li>The
user doesnt exist<li>The hostname doesnt exist<li>etc..etc..<br>Soo stop trusting this stupid
script and use your real email :-)</b>";
}
if (mail($mailto, $subject, $msg, $mailheaders)) echo "<h2>Mail SENT</h2>";