PHP Classes

File: contact_mail.php

Recommend this page to a friend!
  Classes of MarPlo   PHP Contact Form Script   contact_mail.php   Download  
File: contact_mail.php
Role: Application script
Content type: text/plain
Description: Php code that receives form data
Class: PHP Contact Form Script
Send messages using contact forms
Author: By
Last change: changed the code
Date: 11 years ago
Size: 990 bytes


Class file image Download
// Contact Form -
if(!isset($_SESSION)) session_start(); // starts session, if not already started
if(!headers_sent()) header('Content-type: text/html; charset=utf-8'); // sets header for UITF-8 encoding


$to = 'your_email@domain.mail'; // Receiver e-mail address (to which the email will be send)

// If you want to use the SMTP server from GMail, set the value 1 at GMAIL constant
// Add your GMail address at the GMAIL_USER, and add the password for this e-mail at GMAIL_PASS
// If you want to use the local mail server, let GMAIL to 0
define('GMAIL', 0);
define('GMAIL_USER', '');
define('GMAIL_PASS', 'gmail_password');

// include the class that sends the email

// create an object of sendEMail class that sends the email
$obEMail = new sendEMail($to);
$obEMail->re; // output the resulted message