Free PHP HTML Email Starter Script

This script will help you add a versatile and extensible PHP-based HTML email script for any project you may have. This email script has been setup and tested for use with UTF-8 characters.

Features:

  • UTF-8 characters are not a problem
  • Used on many of my own sites
  • Easy to read & easy to expand upon
  • The ability to send attachments is not setup

Installation:

Unzip the contents of the zip file into a folder on your web server. Edit the email_functions.php file to properly set the properties of your business (name, from email, etc.). Next, include that file in the script you are using and call it like so:

$status = sendmail($to, $subject, $message, $from);

$from is optional and it’s default value is set at the top of the email_functions.php file.
$status will be either true or false depending on if the email worked or not.

Download:

You can download this script here: html_email_starter.zip (2KB)

rest_api_starter.zip (12 downloads)

What is my IP Address?

Your IP Address is:

54.165.90.203

PHP:

Read more on the $_SERVER variable.

$ip_address = $_SERVER['REMOTE_ADDR'];

JavaScript:

You need to call a server-side script to accomplish this. First create a PHP file on your server and paste this in it:

<?php
header('content-type: application/json; charset=utf-8');

$data = json_encode($_SERVER['REMOTE_ADDR']);
echo $_GET['callback'] . '(' . $data . ');';

Next, use this JavaScript to call the PHP file you created above.

<script type="application/javascript">
function getip(json){
    alert(json); // alerts the ip address
}
</script>
<script type="application/javascript" src="http://www.anotherdomain.com/file.php?callback=getip" ></script>