<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- @import url("css/styles.css"); --> </style> </head> <body> <form> <div class="box"> <h1>User Registration</h1> <label> <span>Full name</span> <input type="text" class="input_text" name="name" id="name"/> </label> <label> <span>Email</span> <input type="text" class="input_text" name="email" id="email"/> </label> <label> <span>Subject</span> <input type="text" class="input_text" name="subject" id="subject"/> </label> <label> <span>Message</span> <textarea class="message" name="feedback" id="feedback"></textarea> <input type="button" class="button" value="Submit Form" /> </label> </div> </form> </body> </html>
require_once "Mail.php"; $from = "<from.gmail.com>"; $to = "<to.yahoo.com>"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "ssl://smtp.gmail.com"; $port = "465"; $username = "<myaccount.gmail.com>"; $password = "password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } ?>
HTML
PHP
echo
echo "<h1>Hi Folks!</h1>"
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)