Small snippet from me :) It mailed the URL that you've point on the form field. Have a try :)
You can have a test in here: http://herm.czechian.net/url_mailer.php
By : hermawan
<?php
/************************************************
* Snippet Name : URL Mailer *
* Scripted By : Hermawan Haryanto *
* Email : hermawan@codewalkers.com *
* License : GPL (General Public License) *
***********************************************/
if ($_POST) {
$from_name = htmlentities(trim($_POST["from_name"]), ENT_QUOTES);
$from_email = htmlentities($_POST["from_email"], ENT_QUOTES);
if ($from_name != "" && $from_email != "") $from = "$from_name <$from_email>";
elseif ($from_name == "" && $from_email != "") $from = $from_email;
else $from = "Anonymous <anonymous@myserver.com>";
$to_name = htmlentities ($_POST["to_name"], ENT_QUOTES);
$to_email = htmlentities($_POST["to_email"], ENT_QUOTES);
if ($to_name != "" && $to_email != "") $to = "$to_name <$to_email>";
elseif ($to_name == "" && $to_email != "") $to = $to_email;
else $to = "Hermawan Haryanto <hermawan@codewalkers.com>";
$url = trim($_POST["url"]);
if ($url != "") {
if (allow_url_fopen) {
$message = file_get_contents ($url);
} else {
$message = "Your friend is trying to send you this page: $url \r\n";
$message.= "But the server is unable to deliver it for you.";
}
} else {
$message = "No HTML to display.";
}
$subject = "[URLMailer] ".stripslashes(trim($_POST["subject"]));
if ($subject == "") $subject = "[URLMailer] No Subject";
$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: $from \r\n";
@mail ($to, $subject, $message, $headers);
Header ("Location:".$_SERVER["PHP_SELF"]."?send=done");
exit();
}
if ($_GET["send"] == "done") {
$str = "<script language=\"JavaScript\">\n";
$str.= "alert('Email has been sent.!');\n";
$str.= "</script>\n";
print $str;
}
?>
<pre>
<form method="post">
To (Name) : <input type="text" name="to_name" width="25">
To (Email): <input type="text" name="to_email" width="25">
From (Name) : <input type="text" name="from_name" width="25">
From (Email): <input type="text" name="from_email" width="25">
Subject : <input type="text" name="subject" width="25">
URL : <input type="text" name="url" width="25">
<input type="submit" name="action" value="SEND">
</form>
</pre>
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Email Code Articles
More By Codewalkers
developerWorks - FREE Tools! |
The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times. FREE! Go There Now!
|
|
|
|
David Barnes, Lead Evangelist for IBM Emerging Internet Technologies will discuss aspects of Web 2.0 that bring value to corporations, academia, and government. He'll also discuss IBM's vision around Web 2.0, including the importance of remixability and consumability. The discussion will culminate with examples of various IBM Software Group solutions you can use to get ahead of the Web 2.0 adoption curve. FREE! Go There Now!
|
|
|
|
Discover how IBM Rational AppScan Standard Edition can help you detext vulnerabilities in your web applications in the Web Application Security eKit. IBM Rational AppScan is a leading suite of automated web application security solutions that scan and test for common Web application vulnerabilities. The new Web Application Security eKit provides you with valuable resources, including white papers, demos, and additional information on the benefits of testing your Web applications. FREE! Go There Now!
|
|
|
|
Visit IBM developerWorks to download a free trial version of IBM Rational Business Developer V7.1. Rational Business Developer offers rapid and simplified development of business applications and services through Enterprise Generation Language (EGL) tools, generating Java or mainframe solutions while shielding developers from technical complexities. FREE! Go There Now!
|
|
|
|
Join us for this web seminar to learn how you can defend your web applications from attack. Learn about the 3 most common web application attacks, including how they occur and what can be done to prevent them. We’ll also discuss manual versus automated approaches for scanning and identifying web application vulnerabilities and how IBM Rational AppScan, an automated vulnerability scanner, can help you automate more of what you are doing manually today. FREE! Go There Now!
|
|
|
|
Analysts, architects, and developers who have existing COBOL or PL/I skills and want to extend those skills to deploy new workloads on the mainframe can use the IBM Enterprise Modernization Sandbox for System z to find hands-on walkthroughs of common real world scenarios. The scenarios provide examples of how to rapidly design, create, assemble, test, and deploy high-quality Web, Web services, portal, and SOA applications for IBM CICS, IBM IMS, and IBM WebSphere Application Server. FREE! Go There Now!
|
|
|
|
Learn how to implement a build management system that uses and extends your existing automation technologies. This tutorial shows, step-by-step, how to install and configure IBM Rational Build Forge to manage builds for Jakarta Tomcat from source code. FREE! Go There Now!
|
|
|
|
Learn how to do more with your reusable assets with the free Rational Asset Manager eKit. The eKit includes demos on how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse. Plus you’ll find white papers and a Webcast that discuss the challenges of a Service Oriented Architecture and how Rational Asset Manager can provide quick and effective solutions. FREE! Go There Now!
|
|
|
|
The Eclipse community is constantly working to extend Eclipse's functionality. In this webcast, learn about some of the most important and feature-rich projects under development. From multi-language support to plug-in development, tune in to see what Eclipse is capable of now. FREE! Go There Now!
|
|
|
|
Viper 2 brings a great value to developer communities including SQL, XML, PHP, Ruby, .NET and Java. You probably already know that DB2 Express-C is free for developers to develop, deploy and distribute. Viper 2 provides a variety of means that help move your application from the development stage to deployment more rapidly. This webcast shows how to best utilize the latest tools available for developing DB2 applications. FREE! Go There Now!
|
|
|
|
All FREE IBM® developerWorks Tools! |