PHP - Mailer Advise Needed
i want to send products to resellers so they can show it to their clients
but to show it not on my domain i thought of sending an email with html designed as my product details page BUT the problem here is that the forwarding action by my reseller will ruin the html mailer i thought of using php to pdf any other solutions thanks Similar TutorialsHello.
I'm in need of help when it comes to page rendering, is it good practice to have own html file for each controller and controller->method OR 1 view file for each controller and then dynamically change content depending on the method?
My structure is like so:
controllers methods
-------------
services-> repair, car glass.....
info-> contact, about me.....
What is the best or good practice to handle the content in the view? The content is always the same.
Thanks in advance.
I'd truly appreciate any help you can give me with the following PHP form mailer. I get the following error: Parse error: syntax error, unexpected T_ELSE in testcontact.php on line 31 Any ideas on how to fix the error? Also, I need to sanitize the data, but I don't understand how to. Everything I've googled doesn't seem to work. Code: [Select] <?php $firstname = $_POST['firstname']; $lastname = $_POST['lastname']; $email = $_POST['email']; $mailinglist = $_POST['mailinglist']; $companyname = $_POST['companyname']; $address = $_POST['address']; $city = $_POST['city']; $zip = $_POST['zip']; $countrycode = $_POST['countrycode']; $areacode = $_POST['areacode']; $citycode = $_POST['citycode']; $number = $_POST['number']; $fcountrycode = $_POST['fcountrycode']; $fareacode = $_POST['fareacode']; $fcitycode = $_POST['fcitycode']; $fnumber = $_POST['fnumber']; $industry = $_POST['industry']; $product = $_POST['product']; $productnumber = $_POST['productnumber']; $comments = $_POST['comments']; if ($mailinglist != yes) $mailinglist = no; $mail_to = 'example@isp.com'; $subject = 'Webform Data'; $body = "First Name: $firstname \n Last Name: $lastname: \n Email: $email \n Mailing List: $mailinglist \n Company Name: $companyname \n Address: $address \n City: $city \n Zip: $zip \n Phone: $countrycode $areacode $citycode $number \n Fax: $fcountrycode $fareacode $fcitycode $fnumber \n Industry: $industry \n Product: $product \n Number of Packaged Products: $productnumber \n Comments/Questions: $commments "; if (isset($_POST['Submit'])) { mail($to, $subject, $body); echo "You will be contacted shortly."; }; ?> <!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> <link rel="stylesheet" type="text/css" href="main.css" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Contact Us</title> </head> <form action="testcontact.php" method="post">* represents required field<br /> *First Name:<input name="firstname" type="text" maxlength="50" value="<?php echo $_POST['firstname']; ?>" /><br /> *Last Name:<input name="lastname" type="text" maxlength="50" value="<?php echo $_POST['lastname']; ?>" /><br /> *E-mail:<input name="email" type="text" maxlength="50" value="<?php echo $_POST['email']; ?>" /><br /> Join Mailing List(check if yes):<input name="mailinglist" type="checkbox" value="<?php echo $_POST['mailinglist']; ?>"/><br /> Company Name:<input name="companyname" type="text" maxlength="100" value="<?php echo $_POST['companyname']; ?>" /><br /> Address:<input name="address" type="text" maxlength="100" value="<?php echo $_POST['address']; ?>" /><br /> City:<input name="city" type="text" maxlength="100" value="<?php echo $_POST['city']; ?>" /><br /> Zip<input name="zip" type="text" maxlength="10" value="<?php echo $_POST['zip']; ?>" /><br /> Phone Number:<input name="countrycode" type="text" size="3" maxlength="3" value="<?php echo $_POST['countrycode']; ?>" />-<input name="areacode" type="text" size="3" maxlength="3" value="<?php echo $_POST['areacode']; ?>" />-<input name="citycode" type="text" size="3" maxlength="3" value="<?php echo $_POST['citycode']; ?>" />-<input name="number" type="text" size="4" maxlength="4" value="<?php echo $_POST['number']; ?>" /><br /> Fax:<input name="fcountrycode" type="text" size="3" maxlength="3" value="<?php echo $_POST['fcountrycode']; ?>" />-<input name="fareacode" type="text" size="3" maxlength="3" value="<?php echo $_POST['fareacode']; ?>" />-<input name="fcitycode" type="text" size="3" maxlength="3" value="<?php echo $_POST['fcitycode']; ?>" />-<input name="fnumber" type="text" size="4" maxlength="4" value="<?php echo $_POST['fnumber']; ?>" /><br /> Industry:<input name="industry" type="text" maxlength="50" value="<?php echo $_POST['industry']; ?>" /><br /> Product Packaged:<input name="product" type="text" maxlength="100" value="<?php echo $_POST['product']; ?>" /><br /> Number of Packaged Products:<input name="productnumber" type="text" maxlength="100" value="productnumber" /><br /> Comments/Questions:<br /><textarea name="comments" rows="5" cols="50" maxlength="10000"><?php echo $_POST['comments']; ?></textarea><br /> <input type="submit" value="submit" /> </form> </body> </html> Thanks! <?php class Action { protected $_request; protected $_response; protected $_model; protected $_view; public function __construct(Request $request, Response $response) { $this->set_request($request)->set_response($response)->set_view($request, $response)->set_model(); // if request requires partial then do this $partial = Partial::singleton(); $view = $this->get_view(); $view->set_partial($partial); $partial->set_view(clone $view); } protected function set_request(Request $request) { $this->_request = $request; return $this; } protected function set_response(Response $response) { $this->_response = $response; return $this; } protected function set_view(Request $request, Response $response) { $this->_view = new View($request, $response); return $this; } public function get_request() { return $this->_request; } public function get_response() { return $this->_response; } public function get_view() { return $this->_view; } public function dispatch($method, $parameters) { if ($this->get_request()->is_dispatched()) { if(method_exists($this, $method)) { call_user_func_array(array($this, $method), $parameters); } else { echo "unable to load method"; } } } public function __get($property) { $property = '_' . $property; if (property_exists($this, $property) && $property !== '$this->_request' && $property !== '$this->_responce') { return $this->$property; } return false; } public function set_model() { $class_name = get_class($this); $model_name = trim($class_name, "_Controller"); $model_name = strtolower($model_name); $property_name = '_' . $model_name; $model_name = Inflection::singularize($model_name); $model_name = ucfirst($model_name); $model_class = $model_name . '_Model'; $this->{$property_name} = new $model_class(); } } <?php class View { protected $_variables = array(); protected $_helpers = array(); public function __construct(Request $request, Response $response) { } public function __set($name, $value) { $this->_variables[$name] = $value; } public function __get($name) { return $this->_variables[$name]; } public function __call($name, $parameters) { $helper = $this->get_helper($name); if (!$helper) { $helper = call_user_func_array(array(new $name(), '__construct'), $parameters); $this->set_helper($name, $helper); } return $helper; } protected function set_helper($helper, $instance) { $this->_helpers[$helper] = $instance; } protected function get_helper($helper) { if (isset($this->_helpers[$helper])) { return $this->_helpers[$helper]; } return false; } public function set_partial(Partial $partial) { if ($partial instanceof Partial) { $this->set_helper('partial', $partial); } } public function render($file) { if (preg_match("/\.html$/i", $file)) { require_once PRIVATE_DIRECTORY . 'application' . DS . 'views' . DS . $file; } } } <?php class Partial { protected $_view; protected $_templates; protected static $_instance = null; public static function singleton() { if (self::$_instance == null) { self::$_instance = new self(); } return self::$_instance; } public function set_view(View $view) { $this->_view = $view; } public function __set($name, $options = array()) { $this->_templates[$name]; $this->_templates[$name]['path'] = $options[0]; $this->_templates[$name]['variables'] = $options[1]; } public function __get($name) { // when $this->paertial()->header; is called in view template // it extracts variables and includes template view render() method $file = $this->_templates[$name]['path']; $variables = $this->_templates[$name]['variables']; } }Hey guys im trying to make alternations to my personal framework by adding a Partial class as a helper to the View class so that I'm able to add partial templates in my bootstrap and load accordingly in my view template like a header and footer. what im after is a bit of advise on the functioning of my Action/View and Partial please (not sure if what im doing is really right although it does work) Basically my Controller will extend my action where a model and view is made for my controller to use. Then my partial class is sent as a helper to my view and a clone of view sent to my partial so that im able to use the view class in my partial to render my header and variables. (is this the correct way? or a good method?) here's my code...like I said any advise would be greatly appreciated... thank you Hi, im trying to learn about socket in PHP but unfortunatly not getting anywhere fast. The main issue is, the reason i want to learn about them is for use on a project where i will be connecting to a server, not actually being one. So although i am interested in the server part, its not essential. But to test my php socket code, i need something to connect to for debugging? So i have tried to create (from tutorials) a php server but not had any luck at all, can anyone advise me on where to start here? I basically want a way to send a command from a php file over TCP/IP, but for now just want it to bounce back or get a response, is there any test servers out there or do i have to create one? I have my own windows web server running here next to me for all my testing. Thanks Andy hi again guys n gals. Ive just pre-built a website that works fine. ive just moved all files to another server and now when i try to login it does nothing , also if i try to signup it gives this error ................. Code: [Select] Warning: gethostbyaddr() [function.gethostbyaddr]: Address is not a valid IPv4 or IPv6 address in /home/content/70/6589670/html/gaming/signup.php on line 87 i have NOT edited the code in anyway so m guessing its a server issue ... or could i be wrong ??? any help welcome , thanks for reading Ok. So I just started using prepared statements. One issue I ran into is that after inserting say "abc's" into the table with a prepared statement when I read that row and display it, it shows as abc\'s I have to use stripslashes on the variable before displaying it. I thought that with magic quotes. off this would not be a problem. Am I going to have to strip slashes on all fields now? Is there another way around it? here is my phpinfo for reference magic_quotes_gpc Off Off magic_quotes_runtime Off Off magic_quotes_sybase Off Off And compile options Configure Command './configure' '--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-mhash=shared' '--with-mcrypt=shared' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--disable-json' Thanks JT Hey Ok i'd say i'm pretty average with HTML, CSS and PHP I have my own website - www.leedsmethockey.co.uk and i want to develop a new section... i'll try and explain as best i can i have a database with all the players and their email address... When someone is selected for a match i wish the website to email their email address to let them know... please could someone advice me where i need to start and what sort of code i need to be looking into? Many Thanks Before I go digging around for code or conversion to unix time stamp, I'm curious how many of you have a birthday entry on a form which is the least hassle for the person filling out the form. For example a text box and they can enter 12/1/1992 or 12/1/92 or 12-1-1992 or three text boxes for month, day and year and if so, require an 01 or a 08 or 4 characters for year. The second method with three boxes would easily convert to a date stamp entry on the other hand if there is a php conversion that would convert any format (12/1/1992, 12/01/92, etc) to a unix time stamp that would make it easier for the person filling out the form. Thanks in advance for any ideas or help. Mike I got this PHP mailer as part of a template I downloaded. It seems to work for everyone except for me. I would love some help. I followed their documentation as for what to change and you will see it documented as to the area I was supposed to change and the part I should not touch. I only updated the top portion but for some reason its not working. When I tested the contact page after uploading the site, I used one of my own email addresses to send an email to the destination address of my company. I get a response email in the account that I fill in the email field with, but the actual destination email account for my business never gets the message that the customer/I write. This is the code I have so far, so could you please tell me whats wrong. Thanks! Sorry I cant upload files at work. Code: [Select] <?php error_reporting(E_WARNING); $variables = array( "subject" => $_POST["sender_subject"], "message" => $_POST["sender_message"], "name" => $_POST["sender_name"], "email" => $_POST["sender_email"], ); $conf = array( "notification_email" => array( "enable" => true, "to" => "shane@photographybysp.com", "to_name" => "Photography by Shane Padgett", "from" => "{EMAIL}", "from_name" => "{NAME}", "subject" => "New Message: {SUBJECT}", "type" => "html", "message" => <<<EOD <p>Someone new is interested!</p> <p> Email: {EMAIL}<br> Subject: {SUBJECT}<br> {MESSAGE} </p> EOD ), "autoresponder_email" => array( "enable" => true, "from" => "shane@photographybysp.com", "from_name" => "Photography by Shane Padgett", "to" => "{EMAIL}", "to_name" => "{NAME}", "subject" => "Thank you for your message", "type" => "html", "message" => <<<EOD <p>Your message has been recieved!</p> <p> Email: {EMAIL}<br> Subject: {SUBJECT}<br> {MESSAGE} </p> EOD ), ); ## starting the actual code, you have nothing else to configure from this point forward. function SendMail() { $params = AStripSlasshes(func_get_args()); //check to see the numbers of the arguments switch (func_num_args()) { case 1: $email = $params[0]; $vars = array(); break; case 2: $email = $params[0]; $vars = $params[1]; break; case 3: $to = $params[0]; $email = $params[1]; $vars = $params[2]; break; case 4: $to = $params[0]; $to_name = $params[1]; $email = $params[2]; $vars = $params[3]; break; } if ($email["email_status"] == 1) { return true; } $msg = new CTemplate(stripslashes($email["email_body"]) , "string"); $msg = $msg->Replace($vars); $sub = new CTemplate(stripslashes($email["email_subject"]) , "string"); $sub = $sub->Replace($vars); $email["email_from"] = new CTemplate(stripslashes($email["email_from"]) , "string"); $email["email_from"] = $email["email_from"]->Replace($vars); $email["email_from_name"] = new CTemplate(stripslashes($email["email_from_name"]) , "string"); $email["email_from_name"] = $email["email_from_name"]->Replace($vars); if (!$email["email_reply"]) $email["email_reply"] = $email["email_from"]; if (!$email["email_reply_name"]) $email["email_reply_name"] = $email["email_from_name"]; //prepare the headers $headers = "MIME-Version: 1.0\r\n"; if ($email["email_type"] == "html") $headers .= "Content-type: text/html\r\n"; else $headers .= "Content-type: text/plain\r\n"; //prepare the from fields if (!$email["email_hide_from"]) { $headers .= "From: {$email[email_from_name]}<{$email[email_from]}>\r\n"; $headers .= "Reply-To: {$email[email_reply_name]}<{$email[email_reply]}>\r\n"; } $headers .= $email["headers"]; if (!$email["email_hide_to"]) { return @mail($email["email_to"] , $sub, $msg,$headers); } else { } $headers .= "X-Mailer: PHP/" . phpversion(); return mail($to, $sub, $msg,$headers); } function AStripSlasshes($array) { if (is_array($array)) foreach ($array as $key => $item) if (is_array($item)) $array[$key] = AStripSlasshes($item); else $array[$key] = stripslashes($item); else return stripslashes($array); return $array; } $_TSM = array(); class CTemplate { /** * template source data * * @var string * * @access private */ var $input; /** * template result data * * @var string * * @access public */ var $output; /** * template blocks if any * * @var array * * @access public */ var $blocks; /** * constructor which autoloads the template data * * @param string $source source identifier; can be a filename or a string var name etc * @param string $source_type source type identifier; currently file and string supported * * @return void * * @acces public */ function CTemplate($source,$source_type = "file") { $this->Load($source,$source_type); } /** * load a template from file. places the file content into input and output * also setup the blocks array if any found * * @param string $source source identifier; can be a filename or a string var name etc * @param string $source_type source type identifier; currently file and string supported * * @return void * * @acces public */ function Load($source,$source_type = "file") { switch ($source_type) { case "file": $this->template_file = $source; // get the data from the file $data = GetFileContents($source); //$data = str_Replace('$','\$',$data); break; case "rsl": case "string": $data = $source; break; } // blocks are in the form of <!--S:BlockName-->data<!--E:BlockName--> preg_match_all("'<!--S\:.*?-->.*?<!--E\:.*?-->'si",$data,$matches); // any blocks found? if (count($matches[0]) != 0) // iterate thru `em foreach ($matches[0] as $block) { // extract block name $name = substr($block,strpos($block,"S:") + 2,strpos($block,"-->") - 6); // cleanup block delimiters $block = substr($block,9 + strlen($name),strlen($block) - 18 - strlen($name) * 2); // insert into blocks array $this->blocks["$name"] = new CTemplate($block,"string"); } // cleanup block delimiters and set the input/output $this->input = $this->output = preg_replace(array("'<!--S\:.*?-->(\r\n|\n|\n\r)'si","'<!--E\:.*?-- >(\r\n|\n|\n\r)'si"),"",$data); } /** * replace template variables w/ actual values * * @param array $vars array of vars to be replaced in the form of "VAR" => "val" * @param bool $clear reset vars after replacement? defaults to TRUE * * @return string the template output * * @acces public */ function Replace($vars,$clear = TRUE) { if (is_array($vars)) { foreach ($vars as $key => $var) { if (is_array($var)) { unset($vars[$key]); } } } // init some temp vars $patterns = array(); $replacements = array(); // build patterns and replacements if (is_array($vars)) // just a small check foreach ($vars as $key => $val) { $patterns[] = "/\{" . strtoupper($key) . "\}/"; //the $ bug $replacements[] = str_replace('$','\$',$val); } // do regex $result = $this->output = @preg_replace($patterns,$replacements,$this->input); // do we clear? if ($clear == TRUE) $this->Clear(); // return output return $result; } function SepReplace($ssep , $esep , $vars,$clear = TRUE) { if (is_array($vars)) { foreach ($vars as $key => $var) { if (is_array($var)) { unset($vars[$key]); } } } // init some temp vars $patterns = array(); $replacements = array(); // build patterns and replacements if (is_array($vars)) // just a small check foreach ($vars as $key => $val) { $patterns[] = $ssep . strtoupper($key) . $esep; //the $ bug $replacements[] = str_replace('$','\$',$val); } // do regex $result = $this->output = @preg_replace($patterns,$replacements,$this->input); // do we clear? if ($clear == TRUE) $this->Clear(); // return output return $result; } /** * replace a single template variable * * @param string $var variable to be replaced * @param string $value replacement * @param bool $perm makes the change permanent [i.e. replaces input also]; defaults to FALSE * * @return string result of replacement * * @acces public */ function ReplaceSingle($var,$value,$perm = FALSE) { if ($perm) $this->input = $this->Replace(array("$var" => $value)); else return $this->Replace(array("$var" => $value)); } /** * resets all the replaced vars to their previous status * * @return void * * @acces public */ function Clear() { $this->output = $this->input; } /** * voids every template variable * * @return void * * @acces public */ function EmptyVars() { global $_TSM; //$this->output = $this->ReplacE($_TSM["_PERM"]); //return$this->output = preg_replace("'{[A-Z]}'si","",$this->output); return $this->output = preg_replace("'{[A-Z_\-0-9]*?}'si","",$this->output); //return $this->output = preg_replace("'{[\/\!]*?[^{}]*?}'si","",$this->output); } /** * checks if the specified template block exists * * @param string $block_name block name to look for * * @return bool TRUE if exists or FALSE if it doesnt * * @access public */ function BlockExists($block_name) { return isset($this->blocks[$block_name]) && is_object($this->blocks[$block_name])? TRUE : FALSE; } /* function Block($block,$vars = array(),$return_error = false) { if ($this->BlockExists($block)) return $this->blocks[$block]->Replace($vars); else { return ""; } } */ /*Extra functions to keep the compatibility with the new CTemplateDynamic library*/ /** * description * * @param * * @return * * @access */ function BlockReplace($block , $vars = array(), $clear = true){ if (!is_object($this->blocks[$block])) echo "CTemplate::{$this->template_file}::$block Doesnt exists.<br>"; return $this->blocks[$block]->Replace($vars , $clear); } /** * description * * @param * * @return * * @access */ function BlockEmptyVars($block , $vars = array(), $clear = true) { if (!is_object($this->blocks[$block])) echo "CTemplate::{$this->template_file}::$block Doesnt exists.<br>"; if (is_array($vars) && count($vars)) $this->blocks[$block]->Replace($vars , false); return $this->blocks[$block]->EmptyVars(); } /** * description * * @param * * @return * * @access */ function Block($block) { if (!is_object($this->blocks[$block])) echo "CTemplate::{$this->template_file}::$block Doesnt exists.<br>"; return $this->blocks[$block]->output; } } /** * description * * @library * @author * @since */ class CTemplateStatic{ /** * description * * @param * * @return * * @access */ /** * description * * @param * * @return * * @access */ function Replace($tmp , $data = array()) { $template = new CTemplate($tmp , "string"); return $template->replace($data); } function EmptyVars($tmp , $data = array()) { $template = new CTemplate($tmp , "string"); if (count($data)) { $template->replace($data , false); } return $template->emptyvars(); } /** * description * * @param * * @return * * @access */ function ReplaceSingle($tmp , $var , $value) { return CTemplateStatic::Replace( $tmp , array( $var => $value ) ); } } header("Content-Type: text/xml"); if (!$variables["email"]) { echo "<response><message>error</message></response>"; die(); } if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/",$variables["email"])){ echo "<response><message>error</message></response>"; die(""); } //check if the notification should be sent if ($conf["notification_email"]["enable"] == true) { $vars = $variables; foreach ($conf["notification_email"] as $key => $val) { $conf["notification_email"][$key] = CTemplateStatic::Replace($val , $vars); } //process the notify email $email = array( "email_to" => utf8_decode($conf["notification_email"]["to"]), "email_to_name" => utf8_decode($conf["notification_email"]["to_name"]), "email_from" => utf8_decode($conf["notification_email"]["from"]), "email_from_name" => utf8_decode($conf["notification_email"]["from_name"]), "email_subject" => utf8_decode($conf["notification_email"]["subject"]), "email_body" => utf8_decode($conf["notification_email"]["message"]), "email_type" => utf8_decode($conf["notification_email"]["type"]) ); foreach ($email as $key => $val) { $email[$key] = CTemplateStatic::Replace($val , $vars); } SendMail($email); } //check if the notification should be sent if ($conf["autoresponder_email"]["enable"] == true) { $vars = $variables; foreach ($conf["autoresponder_email"] as $key => $val) { $conf["autoresponder_email"][$key] = CTemplateStatic::Replace($val , $vars); } //process the notify email $email = array( "email_to" => utf8_decode($conf["autoresponder_email"]["to"]), "email_to_name" => utf8_decode($conf["autoresponder_email"]["to_name"]), "email_from" => utf8_decode($conf["autoresponder_email"]["from"]), "email_from_name" => utf8_decode($conf["autoresponder_email"]["from_name"]), "email_subject" => utf8_decode($conf["autoresponder_email"]["subject"]), "email_body" => utf8_decode($conf["autoresponder_email"]["message"]), "email_type" => utf8_decode($conf["autoresponder_email"]["type"]) ); foreach ($email as $key => $val) { $email[$key] = CTemplateStatic::Replace($val , $vars); } SendMail($email); } echo "<response><message>sent</message></response>"; die(); ?> MOD EDIT: [code] . . . [/code] tags added. Hi everyone! Newbie in PHP Im trying unsuccessfully to get php mailer to send mail to a specific email address I dont know if its even possible. I have a form in flash but it uses php. Now all the emails that get sent from the site go to a ddatabase and then are posted in the site admin area under contact Im assuming its php mail that send sends these emails. What i would like is it to send those emails to a specific address. I downloaded the latest phpmailer for php 4 since thats what the server is running. Any help would be appreciated. Here ive attached the current mailer file. THANKS. PEACE This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=306860.0 Here's my situation: I had someone create a PHP form for me. I have inserted it into a website I am designing. The form works on my personal host (except still trying to figure out how to have the uploaded file be attached to the sent email), but I am getting an error where the form will actually be hosted. See below. Please let me know if any more info is needed. Form: http://www.jjbuttons.com/order Error on submission: Warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/j/u/m/jumpinjack/html/form/attach_mailer_class.php on line 186 Error while sending you mail. Host: GoDaddy PHP version: 4.4.9 http://www.jjbuttons.com/info.php Same form / code: http://www.chrisdoughmandesign.com/order.html Mail submits (except still trying to figure out how to have uploaded file be attached to email) Host: JustHost PHP version: 5.2.16 http://www.chrisdoughmandesign.com/info.php Code: [Select] <?php if(isset($_POST['cmd']) && ($_POST['cmd'] == 'complete')) { if(isset($_POST['completeorder'])) { //UPDATE THESE VARIABLES $to = 'user@example.com'; // TODO: Change to your desired email. $cc = ""; //OPTIONAL $bcc = ""; //OPTIONAL $subject = 'Order Form Submission'; //TODO: Update to a subject for the email that you like $uploadpath = $_SERVER['DOCUMENT_ROOT']."/files/mail/"; //TODO: Change path to match your environment $max_size = 1024*2; //TODO: Update the max. size for uploading in kbs require($_SERVER['DOCUMENT_ROOT']."/form/attach_mailer_class.php"); //TODO: Change path to match your environment include ($_SERVER['DOCUMENT_ROOT']."/form/upload_class.php"); //TODO: Change path to match your environment //EDITTING BELOW THIS SHOULD NOT BE NECESSARY $name = $_POST['fname'] . ' ' . $_POST['lname']; $from = $_POST['email']; $msg = ""; $body =' <!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> .rounded_corners { border-radius: 15px; -moz-border-radius: 15px; } fieldset { margin:10px auto; } #commentForm label.error, #commentForm input.submit { margin-left: 10px; } </style> </head> <body> <div style="margin:0 auto; width:900px; padding:10px;"> <fieldset class="rounded_corners"> <LEGEND ACCESSKEY=I style="font-weight:bold; padding:1px 5px;"> Billing / Shipping Information</LEGEND> <div style="float:left; width:430px; "> <div class="rounded_corners" style="background-color:#EEE; padding:5px; font-weight:bold; ">Bill To:</div> <div> <table style="margin-left:5px; width:100%:" cellpadding="3" cellspacing="0"> <tr> <td style="width:110px; text-align:right;">* First Name:</td> <td style="width:290px;">'.$_POST['fname'].'</td> </tr> <tr> <td style="text-align:right;">* Last Name:</td> <td>'.$_POST['lname'].'</td> </tr> <tr> <td style="text-align:right;">Company:</td> <td>'.$_POST['company'].'</td> </tr> <tr> <td style="text-align:right;">Address 1</td> <td>'.$_POST['add1'].'</td> </tr> <tr> <td style="text-align:right;">Address 2</td> <td>'.$_POST['add2'].'</td> </tr> <tr> <td style="text-align:right;">City:</td> <td>'.$_POST['city'].'</td> </tr> <tr> <td style="text-align:right;">State:</td> <td>'.$_POST['state'].'</td> </tr> <tr> <td style="text-align:right;">* Zip:</td> <td>'.$_POST['zip'].'</td> </tr> <tr> <td style="text-align:right;">* Phone:</td> <td>'.$_POST['phone'].'</td> </tr> <tr> <td style="text-align:right;">* Email:</td> <td>'.$_POST['email'].'</td> </tr> </table> </div> </div> <div style="float:right; width:430px;"> <div class="rounded_corners" style="background-color:#EEE; padding:5px; font-weight:bold; "> <span style="float:left;">Ship To:</span> <span style="float:right;"><input type="checkbox" name="sameasbilling" id="sameasbilling" /></span> <div style="clear:both; height:1px;"></div> </div> <div> <table style="margin-left:5px; width:100%:" cellpadding="3" cellspacing="0"> <tr> <td style="width:110px; text-align:right;">* First Name:</td> <td style="width:290px;">'.$_POST['fname2'].'</td> </tr> <tr> <td style="text-align:right;">* Last Name:</td> <td>'.$_POST['lname2'].'</td> </tr> <tr> <td style="text-align:right;">Company:</td> <td>'.$_POST['company2'].'</td> </tr> <tr> <td style="text-align:right;">Address 1</td> <td>'.$_POST['add12'].'</td> </tr> <tr> <td style="text-align:right;">Address 2</td> <td>'.$_POST['add22'].'</td> </tr> <tr> <td style="text-align:right;">City:</td> <td>'.$_POST['city2'].'</td> </tr> <tr> <td style="text-align:right;">State:</td> <td>'.$_POST['state2'].'</td> </tr> <tr> <td style="text-align:right;">* Zip:</td> <td>'.$_POST['zip2'].'</td> </tr> <tr> <td style="text-align:right;">* Phone:</td> <td>'.$_POST['phone2'].'</td> </tr> </table> </div> </div> <div style="clear:both; height:1px;"></div> <div style="width:100%; text-align:center;"> * indicates required information</div> </fieldset> <fieldset class="rounded_corners"> <legend accesskey="2" style="font-weight:bold; padding:1px 5px;"> Order</LEGEND> <div class="rounded_corners" style="background-color:#EEE; padding:5px; font-weight:bold; "> <table style="width:100%;"> <tr> <td style="width: 150px;"></td> <td style="font-weight:bold; text-align:center;">Button Size</td> <td style="font-weight:bold; text-align:center;">Quantity</td> <td style="font-weight:bold; text-align:center;">Button Back</td> <td style="font-weight:bold; text-align:center;"></td> </tr> </table> </div> <div style="width:100%; padding:5px;"> <table style="width:100%;" cellpadding="2"> <tr> <td style="width: 150px; text-align:center; font-weight:bold;">* Product 1</td> <td style="">'.$_POST['size1'].'</td> <td style="">'.$_POST['qty1'].'</td> <td style="">'.$_POST['back1'].'</td> <td style=""></td> </tr>'; if(isset($_POST['size2']) && isset($_POST['qty2']) && isset($_POST['back2'])) { $body .= '<tr> <td style="width: 150px; text-align:center; font-weight:bold;">Product 2</td> <td style="">'.$_POST['size2'].'</td> <td style="">'.$_POST['qty2'].'</td> <td style="">'.$_POST['back2'].'</td> <td style=""></td> </tr>'; } if(isset($_POST['size3']) && isset($_POST['qty3']) && isset($_POST['back3'])) { $body .= '<tr> <td style="width: 150px; text-align:center; font-weight:bold;">Product 3</td> <td style="width: 150px; text-align:center; font-weight:bold;">Product 2</td> <td style="">'.$_POST['size3'].'</td> <td style="">'.$_POST['qty3'].'</td> <td style="">'.$_POST['back3'].'</td> <td style=""></td> </tr>'; } if(isset($_POST['size4']) && isset($_POST['qty4']) && isset($_POST['back4'])) { $body .= '<tr> <td style="width: 150px; text-align:center; font-weight:bold;">Product 4</td> <td style="width: 150px; text-align:center; font-weight:bold;">Product 2</td> <td style="">'.$_POST['size4'].'</td> <td style="">'.$_POST['qty4'].'</td> <td style="">'.$_POST['back4'].'</td> <td style=""></td> </tr>'; } $body .= '</table> </div> </fieldset> <fieldset class="rounded_corners"> <LEGEND accesskey="3" style="font-weight:bold; padding:1px 5px;">Miscellaneous Info</LEGEND> <table cellpadding="5"> <tr> <td style="width:280px; text-align:center;">*When do you need your order?</td> <td style="width:280px; text-align:center;">'.$_POST['month'].'</td> <td style="width:280px; text-align:center;">'.$_POST['days'].'</td> </tr> <tr> <td style="width:280px; text-align:center;">Is this a Quote or an Order?</td> <td style="width:280px; text-align:center;">'.$_POST['saletype'].'</td> <td style="width:280px; text-align:center;"></td> </tr> <tr> <td style="width:280px; text-align:center;">Have you ordered from us before?</td> <td style="width:280px; text-align:center;">'.$_POST['prevorder'].'</td> <td style="width:280px; text-align:center;"></td> </tr> <tr> <td colspan="3" style="width:100%; text-align:center; font-weight:bold;"> Comments, questions, special instructions: </td> </tr> <tr> <td colspan="3" style="width:100%; text-align:center;"> '.$_POST['comments'].' </td> </tr> </table> </fieldset> </div> </body> </html>'; $my_mail = new attach_mailer($name , $from , $to, $cc , $bcc, $subject, $body); if (isset($_FILES)) { foreach ($_FILES as $key => $file) { for($i = 0; $i < count($file['name']); $i++) { if(isset($file['tmp_name'][$i]) && $file['tmp_name'][$i] != '') { $my_upload = new file_upload; $my_upload->extensions = array(".ai", ".eps", ".pdf", ".psd", ".jpg", ".jpeg"); $my_upload->rename_file = false; $my_upload->upload_dir = $uploadpath; $my_upload->the_temp_file = $file['tmp_name'][$i]; $my_upload->the_file = $file['name'][$i]; $my_upload->http_error = $file['error'][$i]; if ($my_upload->upload()) { $full_path = $my_upload->upload_dir.$my_upload->file_copy; $my_mail->create_attachment_part($full_path); $my_upload->del_temp_file($full_path); } $msg .= $my_upload->show_error_string(); } } } } $my_mail->process_mail(); $msg .= $my_mail->get_msg_str(); echo $msg; } } elseif(isset($_POST['cmd']) && $_POST['cmd'] == 'set_opts') { switch ($_POST['selected']) { case '1\" Round': $options = array('Select Back Button', 'Pin Back','Magnet Back','Zipper Pull'); break; case '1.25\" Round': $options = array('Select Back Button', 'Pin Back','Magnet Back','Zipper Pull'); break; case '2.25\" Round': $options = array('Select Back Button', 'Pin Back','Magnet Back', 'Bottle Opener', 'Bottle Opener With Key Ring'); break; case '3\" Round': $options = array('Select Back Button', 'Pin Back','Magnet Back'); break; case '3.5\" Round': $options = array('Select Back Button', 'Pin Back','Magnet Back'); break; case '2x3\" Rectangle': $options = array('Select Back Button', 'Pin Back','Magnet Back'); break; case '3x2\" Vertical Rectangle': $options = array('Select Back Button', 'Pin Back','Magnet Back'); break; case '2x2 Square': $options = array('Select Back Button', 'Pin Back','Magnet Back'); break; case '2x2 Diamond': $options = array('Select Back Button', 'Pin Back','Magnet Back'); break; case 'Select Button Size': $options = array('Select Back Button'); break; } echo json_encode(array('result' => $options)); } ?> Hi guyz. I need to create a Booking System using form. same like this: https://www.theorytest.net/book-your-theory-test.php Information will be sent to Email. I know the form creation and sending to Email as well! But i this form is divided into pages how can i collect information that will be available to send through email at the end. (when user will complete this booking) Waiting for your reply Thanks OK so to start. We have our domain in the format X.com. Our new-mail form (php) is under mails.X.com. We use phpmail for sending mails. Receiving is disabled. There is apcall for mail() function in button's onclick event. Works as intended (gets call transmitted to phpmail function as well as MTP's) but mails never leaves our servers (and reaches receipient(s)). What may the problem be? Hi guys I need some help here about mailer. I have created a file register new user (register.php) and when a new user register an email will be sent to their address. I have this code on my register file but when I run them it's okay but I did not get the email... can anyone assist me what I did wrong? Thanks. <?php $to = "someone@example.com"; //change to a valid email $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "someonelse@example.com"; //change to a valid email $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo "Mail Sent."; ?> Hi there! I have two different hosting services: on the first one I can regularly use the function mail(), but the second does not allow me to send mails (it will block the account for mass mailing). I need to use mail to notify things to user who requested it, so I need to be able to send mail from this second server too. I thought that I will create a mailer script on the firs server, so that the second will simply call the script when needed, passing the e-mail addresses, the subject and content trough POST. Now, how to avoid that some malicious user uses my script to send own mails? I thought that I can send with the POST two vars, "time" and "secure_code" (I will eventually fake the names, so that is not so easy to recognize), where "time" is get by time(), and "secure_code" is a function depending on the value of "time". The mailer script gets the both values, and use the same function to verify if the "secure_code" is correct, according to time. Question is, is this safe? What kind of function shall I use? Also, how could I avoid that a malicious user simply same the "time" and "secure_code" in a certain moment, and use it again? Thanks in advance. hi, I'm a newb. barely getting my feet wet in php after years of wanting to. I wrote this script following a youtube tutorial and it all made sense as I coded it.... so as far as I'm familiar with the little bit of coding, my script should work. actually it works. I get an email but with no data??? I can't get the script to gather the info and send it along with the email. not sure why as all seems in place.any help here would be greatly appreciated. thank you. here is the script... <?php /*subject and email variables */ $emailSubject = 'edson vehicle order form'; $webMaster = 'order@edsonvehicleremarketing.com'; /*gathering data variables*/ $modelyear = $_POST['modelyear']; $vehiclemake = $_POST['vehiclemake']; $vehiclemodel = $_POST['vehiclemodel']; $colors = $_POST['colors']; $notcolors = $_POST['notcolors']; $options = $_POST['options']; $descriptions = $_POST['descriptions']; $tradeinyear = $_POST['tradeinyear']; $tradeinmake = $_POST['tradeinmake']; $tradeinmodel = $_POST['tradeinmodel']; $miles = $_POST['miles']; $tradeincolor = $_POST['tradeincolor']; $conditionofcar = $_POST['conditionofcar']; $damage = $_POST['damage']; $lienholder = $_POST['lienholder']; $name = $_POST['name']; $homephone = $_POST['homephone']; $workphone = $_POST['workphone']; $cellphone = $_POST['cellphone']; $besttimetoreach = $_POST['besttimetoreach']; $bestwaytocontact = $_POST['bestwaytocontact']; $paymenttype = $_POST['paymenttype']; $howdidyoulocateus = $_POST['howdidyoulocateus']; $pickuptime = $_POST['pickuptime']; $comments = $_POST['comments']; $body - <<<EOD <br><hr><br> Model year: $modelyear <br> Vehicle make: $vehiclemake <br> Vehicle model: $vehiclemodel <br> Vehicle colors: $colors <br> Colors not considered: $notcolors <br> Options desired: $options <br> Descriptions: $descriptions <br> Trade in year: $tradeinyear <br> Trade in make: $tradeinmake <br> Trade in model: $tradeinmodel <br> miles: $miles <br> Trade in color: $tradeincolor <br> Condition of car: $conditionofcar <br> Damage: $damage <br> Lienholder: $lienholder <br> Name: $name <br> Home phone: $homephone <br> Work phone: $workphone <br> Cell phone: $cellphone <br> Best time to reach: $besttimetoreach <br> Best way to contact: $bestwaytocontact <br> Payment type: $paymenttype <br> How did you locate us: $howdidyoulocateus <br> Pick up time: $pickuptime <br> Comments: $comments <br> EOD; $headers = "From $name\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headrers); /* results rendered as html */ $theResults = <<<EOD <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Edson Vehicle Remarketing</title> <style type="text/css"> body { background-color: #000; background-image: url(); background-repeat: repeat-x; margin-bottom: 0px; } .orderform { left: auto; right: auto; margin-top: 25px; } #htmlforphp { width: auto; height: 300px; text-align: center; padding-top: 250px; padding-right: 50px; font-size: 20px; } </style> <link href="css/layout.css" rel="stylesheet" type="text/css" /> <style type="text/css"> a:link { text-decoration: none; color: #000; } a:visited { text-decoration: none; color: #000; } a:hover { text-decoration: none; color: #333; } a:active { text-decoration: none; color: #666; } #wrapper #bodyArea .orderform { padding-left: 100px; padding-right: 100px; position: relative; color: #999; } </style> </head> <body> <div id="wrapper"> <div id="logo"><img src="images/banner.gif" width="800" height="110" alt="edson vehicle remarketing" /></div> <div id="navigation"><strong><a href="index.html">HOME</a> | <a href="inventory.html">INVENTORY</a> | <a href="financing.php">FINANCING</a> | <a href="orderform.html">ORDER FORM</a> | <a href="directions.html">DIRECTIONS</a> | <a href="contactus.html">CONTACT US</a></strong></div> <div id="bodyArea"> <div id="htmlforphp">Thank you for your interest.<br />Edson vehicle remarketinng will find you the best car possible!</div> </div> <div id="footer"><a href="index.html">home</a> | <a href="inventory.html">inventory</a> | <a href="financing.php">financing</a> | <a href="orderform.html">order form</a> | <a href="directions.html">directions</a> | <a href="contactus.html">contact us</a></div> </div> </body> </html> EOD; echo "$theResults"; ?> does anyone have any update on this? I am using it pretty heavily, and someone who has a gmail account just told me that their message was sent to spam. I have a gmail account myself and last night I ran a test and it was not sent there for me. I guess google could be doing some algorithmic nonsense to analyze behavior patterns, but I would guess not in this case. Does anyone know the status of some of the major email clients and their acceptance of PHP mailer receipts? I know the DNS is also associated, but the test that I ran myself came to the inbox without the need for a DNS change. gmail simply popped up a warning of information. thank you guys. I'm just fishing for info here as to see what I can do to stop this. Hi All, Need your help with the situation I am stuck in. I have created a HTML Form and using PHP file saving that data into database. But now I want to send out an generic email to each visitor who fill the form. Attaching the code of html form and php database. It would be highly appreaciated if you can help me in updating the php file with which I can send an auto email.
HTML Form - <!-- .contact-form --> <div class="contact-form"> <form id="contact-form" class="validate-form" method="post" action="send.php"> <!-- enter mail subject here --> <input type="hidden" name="subject" id="subject" value="You have a new message from Smeet Mehta!"> <p> <label for="name">NAME</label> <input type="text" name="name" id="name" class="required"> </p> <p> <label for="email">EMAIL</label> <input type="text" name="email" id="email" class="required email"> </p> <p> <label for="message">MESSAGE</label> <textarea name="message" id="message" class="required"></textarea> </p> <p> <button class="submit" control-id="ControlId-5">Send</button> </p> </form> </div> <!-- .contact-form -->
PHP Code - <?php $subject = filter_input(INPUT_POST, 'subject'); $name = filter_input(INPUT_POST, 'name'); $email = filter_input(INPUT_POST, 'email'); $message = filter_input(INPUT_POST, 'message'); $host = "localhost"; $username = "root"; $password = ""; $dbname = "contact"; $conn = new mysqli ($host, $username, $password, $dbname); if (mysqli_connect_error()){ die('Connection Error('.mysqli_connect_error().')'.mysqli_connect_error()); } else { $sql = "INSERT INTO form (subject, name, email, message) values ('$subject', '$name', '$email', '$message')" ; if ($conn->query($sql)){ header("Refresh:0; url=index.html"); } else{ echo "Error: ".$sql ." ".$conn->error; } $conn->close(); } ?> Please Help Edited July 27 by Barandcode tags added Hello all! First post. Wondering if anyone could help me out with a problem I've been having with a form mailer... I had it working at one point in time, but now not so much. I'm using Securimage as a captcha The file is email.php My problem is... When you type in the code wrong, it tells you its wrong. When you type the code right, it redirects to thank.html, which is correct...but never sends the mail! Am I missing something obvious? Here's my code: Code: [Select] <?php session_start(); //include_once $_SERVER['DOCUMENT_ROOT'] . '/coaxicom_email_original/securimage/securimage.php'; include_once('securimage/securimage.php'); $securimage = new Securimage(); if( isset($_POST['submit'])) { if ($securimage->check($_POST['captcha_code']) == false) { // the code was incorrect // you should handle the error so that the form processor doesn't continue // or you can use the following code if there is no validation or you do not know how echo "The security code entered was incorrect.<br /><br />"; echo "<a href='email.php'>Please click this link to back and try again.</a>"; exit; } //Data $contact1 = $_POST['contact1']; $company1 = $_POST['company1']; $email1 = $_POST['email1']; $phone1 = $_POST['phone1']; $country1 = $_Post['country1']; $address1 = $_POST['address1']; $city1 = $_POST['city1']; $state1 = $_POST['state1']; $zip1 = $_POST['zip1']; $contact2 = $_POST['contact2']; $company2 = $_POST['company2']; $email2 = $_POST['email2']; $phone2 = $_POST['phone2']; $country2 = $_Post['country2']; $address2 = $_POST['address2']; $city2 = $_POST['city2']; $state2 = $_POST['state2']; $zip2 = $_POST['zip2']; $contact3 = $_POST['contact3']; $company3 = $_POST['company3']; $email3 = $_POST['email3']; $phone3 = $_POST['phone3']; $country3 = $_Post['country3']; $address3 = $_POST['address3']; $city3 = $_POST['city3']; $state3 = $_POST['state3']; $zip3 = $_POST['zip3']; $contact4 = $_POST['contact4']; $company4 = $_POST['company4']; $email4 = $_POST['email4']; $phone4 = $_POST['phone4']; $country4 = $_Post['country4']; $address4 = $_POST['address4']; $city4 = $_POST['city4']; $state4 = $_POST['state4']; $zip4 = $_POST['zip4']; $contact5 = $_POST['contact5']; $company5 = $_POST['company5']; $email5 = $_POST['email5']; $phone5 = $_POST['phone5']; $country5 = $_Post['country5']; $address5 = $_POST['address5']; $city5 = $_POST['city5']; $state5 = $_POST['state5']; $zip5 = $_POST['zip5']; $contact6 = $_POST['contact6']; $company6 = $_POST['company6']; $email6 = $_POST['email6']; $phone6 = $_POST['phone6']; $country6 = $_Post['country6']; $address6 = $_POST['address6']; $city6 = $_POST['city6']; $state6 = $_POST['state6']; $zip6 = $_POST['zip6']; $contact7 = $_POST['contact7']; $company7 = $_POST['company7']; $email7 = $_POST['email7']; $phone7 = $_POST['phone7']; $country7 = $_Post['country7']; $address7 = $_POST['address7']; $city7 = $_POST['city7']; $state7 = $_POST['state7']; $zip7 = $_POST['zip7']; $contact8 = $_POST['contact8']; $company8 = $_POST['company8']; $email8 = $_POST['email8']; $phone8 = $_POST['phone8']; $country8 = $_Post['country8']; $address8 = $_POST['address8']; $city8 = $_POST['city8']; $state8 = $_POST['state8']; $zip8 = $_POST['zip8']; $body = <<<EOD <br /><hr><br /> Company: $company1 <br /> Contact: $contact1 <br /> Email: $email1 <br /> Phone: $phone1 <br /> Country: $country1 <br /> Address: $address1 <br /> City: $city1 <br /> State: $state1 <br /> Zip: $zip1 <br /> <br /><hr><br /> Company: $company2 <br /> Contact: $contact2 <br /> Email: $email2 <br /> Phone: $phone2 <br /> Country: $country2 <br /> Address: $address2 <br /> City: $city2 <br /> State: $state2 <br /> Zip: $zip2 <br /> <br /><hr><br /> Company: $company3 <br /> Contact: $contact3 <br /> Email: $email3 <br /> Phone: $phone3 <br /> Country: $country3 <br /> Address: $address3 <br /> City: $city3 <br /> State: $state3 <br /> Zip: $zip3 <br /> <br /><hr><br /> Company: $company4 <br /> Contact: $contact4 <br /> Email: $email4 <br /> Phone: $phone4 <br /> Country: $country4 <br /> Address: $address4 <br /> City: $city4 <br /> State: $state4 <br /> Zip: $zip4 <br /> <br /><hr><br /> Company: $company5 <br /> Contact: $contact5 <br /> Email: $email5 <br /> Phone: $phone5 <br /> Country: $country5 <br /> Address: $address5 <br /> City: $city5 <br /> State: $state5 <br /> Zip: $zip5 <br /> <br /><hr><br /> Company: $company6 <br /> Contact: $contact6 <br /> Email: $email6 <br /> Phone: $phone6 <br /> Country: $country6 <br /> Address: $address6 <br /> City: $city6 <br /> State: $state6 <br /> Zip: $zip6 <br /> <br /><hr><br /> Company: $company7 <br /> Contact: $contact7 <br /> Email: $email7 <br /> Phone: $phone7 <br /> Country: $country7 <br /> Address: $address7 <br /> City: $city7 <br /> State: $state7 <br /> Zip: $zip7 <br /> <br /><hr><br /> Company: $company8 <br /> Contact: $contact8 <br /> Email: $email8 <br /> Phone: $phone8 <br /> Country: $country8 <br /> Address: $address8 <br /> City: $city8 <br /> State: $state8 <br /> Zip: $zip8 <br /> <br /><hr><br /> EOD; //Subject and Email $emailSubject = 'This is my subject'; $webMaster = 'example@gmail.com'; $headers = "From: Example\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster,$emailSubject,$body,$headers); header( "Location: thank.html" ); } else { ?> <!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></head> <body> <div id="wrapper"> <div id="main"> <div id="fContainer"> <form action="email.php" method="post" > <div class="fbox" id="f1"> <div class="fLine"><div class="fLabel">Company Name:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="company1" /></div></div> <br /> <div class="fLine"><div class="fLabel">Contact:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="contact1" /></div></div> <br /> <div class="fLine"><div class="fLabel">E-mail:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="email1" /></div></div> <br /> <div class="fLine"><div class="fLabel">Phone:</div> <div class="fInput"><input type="text" size="15" maxlength="50" name="phone1" /></div></div> <br /> <div class="fLine"><div class="fLabel">Country:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="country1" /></div></div> <br /> <div class="fLine"><div class="fLabel">Address:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="address1" /></div></div> <br /> <div class="fLine"><div class="fLabel">City:</div> <div class="fInput"><input type="text" size="18" maxlength="100" name="city1" /></div></div> <br /> <div class="fLine"><div class="fLabel">State:</div> <div class="fInput"><input type="text" size="10" maxlength="100" name="state1" /></div></div> <br /> <!-- end #f1 --></div> <div class="fbox" id="f2"> <div class="fLine"><div class="fLabel">Company Name:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="company2" /></div></div> <br /> <div class="fLine"><div class="fLabel">Contact:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="contact2" /></div></div> <br /> <div class="fLine"><div class="fLabel">E-mail:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="email2" /></div></div> <br /> <div class="fLine"><div class="fLabel">Phone:</div> <div class="fInput"><input type="text" size="15" maxlength="50" name="phone2" /></div></div> <br /> <div class="fLine"><div class="fLabel">Country:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="country2" /></div></div> <br /> <div class="fLine"><div class="fLabel">Address:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="address2" /></div></div> <br /> <div class="fLine"><div class="fLabel">City:</div> <div class="fInput"><input type="text" size="18" maxlength="100" name="city2" /></div></div> <br /> <div class="fLine"><div class="fLabel">State:</div> <div class="fInput"><input type="text" size="10" maxlength="100" name="state2" /></div></div> <br /> <!-- end #f2 --></div> <div class="fbox" id="f3"> <div class="fLine"><div class="fLabel">Company Name:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="company3" /></div></div> <br /> <div class="fLine"><div class="fLabel">Contact:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="contact3" /></div></div> <br /> <div class="fLine"><div class="fLabel">E-mail:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="email3" /></div></div> <br /> <div class="fLine"><div class="fLabel">Phone:</div> <div class="fInput"><input type="text" size="15" maxlength="50" name="phone3" /></div></div> <br /> <div class="fLine"><div class="fLabel">Country:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="country3" /></div></div> <br /> <div class="fLine"><div class="fLabel">Address:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="address3" /></div></div> <br /> <div class="fLine"><div class="fLabel">City:</div> <div class="fInput"><input type="text" size="18" maxlength="100" name="city3" /></div></div> <br /> <div class="fLine"><div class="fLabel">State:</div> <div class="fInput"><input type="text" size="10" maxlength="100" name="state3" /></div></div> <br /> <!-- end #f3 --></div> <div class="fbox" id="f4"> <div class="fLine"><div class="fLabel">Company Name:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="company4" /></div></div> <br /> <div class="fLine"><div class="fLabel">Contact:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="contact4" /></div></div> <br /> <div class="fLine"><div class="fLabel">E-mail:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="email4" /></div></div> <br /> <div class="fLine"><div class="fLabel">Phone:</div> <div class="fInput"><input type="text" size="15" maxlength="50" name="phone4" /></div></div> <br /> <div class="fLine"><div class="fLabel">Country:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="country4" /></div></div> <br /> <div class="fLine"><div class="fLabel">Address:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="address4" /></div></div> <br /> <div class="fLine"><div class="fLabel">City:</div> <div class="fInput"><input type="text" size="18" maxlength="100" name="city4" /></div></div> <br /> <div class="fLine"><div class="fLabel">State:</div> <div class="fInput"><input type="text" size="10" maxlength="100" name="state4" /></div></div> <br /> <!-- end #f4 --></div> <div class="fbox" id="f5"> <div class="fLine"><div class="fLabel">Company Name:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="company5" /></div></div> <br /> <div class="fLine"><div class="fLabel">Contact:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="contact5" /></div></div> <br /> <div class="fLine"><div class="fLabel">E-mail:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="email5" /></div></div> <br /> <div class="fLine"><div class="fLabel">Phone:</div> <div class="fInput"><input type="text" size="15" maxlength="50" name="phone5" /></div></div> <br /> <div class="fLine"><div class="fLabel">Country:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="country5" /></div></div> <br /> <div class="fLine"><div class="fLabel">Address:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="address5" /></div></div> <br /> <div class="fLine"><div class="fLabel">City:</div> <div class="fInput"><input type="text" size="18" maxlength="100" name="city5" /></div></div> <br /> <div class="fLine"><div class="fLabel">State:</div> <div class="fInput"><input type="text" size="10" maxlength="100" name="state5" /></div></div> <br /> <!-- end #f5 --></div> <div class="fbox" id="f6"> <div class="fLine"><div class="fLabel">Company Name:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="company6" /></div></div> <br /> <div class="fLine"><div class="fLabel">Contact:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="contact6" /></div></div> <br /> <div class="fLine"><div class="fLabel">E-mail:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="email6" /></div></div> <br /> <div class="fLine"><div class="fLabel">Phone:</div> <div class="fInput"><input type="text" size="15" maxlength="50" name="phone6" /></div></div> <br /> <div class="fLine"><div class="fLabel">Country:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="country6" /></div></div> <br /> <div class="fLine"><div class="fLabel">Address:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="address6" /></div></div> <br /> <div class="fLine"><div class="fLabel">City:</div> <div class="fInput"><input type="text" size="18" maxlength="100" name="city6" /></div></div> <br /> <div class="fLine"><div class="fLabel">State:</div> <div class="fInput"><input type="text" size="10" maxlength="100" name="state6" /></div></div> <br /> <!-- end #f6 --></div> <div class="fbox" id="f7"> <div class="fLine"><div class="fLabel">Company Name:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="company7" /></div></div> <br /> <div class="fLine"><div class="fLabel">Contact:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="contact7" /></div></div> <br /> <div class="fLine"><div class="fLabel">E-mail:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="email7" /></div></div> <br /> <div class="fLine"><div class="fLabel">Phone:</div> <div class="fInput"><input type="text" size="15" maxlength="50" name="phone7" /></div></div> <br /> <div class="fLine"><div class="fLabel">Country:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="country7" /></div></div> <br /> <div class="fLine"><div class="fLabel">Address:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="address7" /></div></div> <br /> <div class="fLine"><div class="fLabel">City:</div> <div class="fInput"><input type="text" size="18" maxlength="100" name="city7" /></div></div> <br /> <div class="fLine"><div class="fLabel">State:</div> <div class="fInput"><input type="text" size="10" maxlength="100" name="state7" /></div></div> <br /> <!-- end #f7 --></div> <div class="fbox" id="f8"> <div class="fLine"><div class="fLabel">Company Name:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="company8" /></div></div> <br /> <div class="fLine"><div class="fLabel">Contact:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="contact8" /></div></div> <br /> <div class="fLine"><div class="fLabel">E-mail:</div> <div class="fInput"><input type="text" size="25" maxlength="150" name="email8" /></div></div> <br /> <div class="fLine"><div class="fLabel">Phone:</div> <div class="fInput"><input type="text" size="15" maxlength="50" name="phone8" /></div></div> <br /> <div class="fLine"><div class="fLabel">Country:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="country8" /></div></div> <br /> <div class="fLine"><div class="fLabel">Address:</div> <div class="fInput"><input type="text" size="20" maxlength="300" name="address8" /></div></div> <br /> <div class="fLine"><div class="fLabel">City:</div> <div class="fInput"><input type="text" size="18" maxlength="100" name="city8" /></div></div> <br /> <div class="fLine"><div class="fLabel">State:</div> <div class="fInput"><input type="text" size="10" maxlength="100" name="state8" /></div></div> <br /> <!-- end #f8 --></div> <div id="fCaptcha"> <div id="codeLabel">Security Code<span class="red">*</span>:</div> <div id="img"><img id="captcha" src="securimage/securimage_show.php" alt="CAPTCHA Image" /></div> <div id="text"> <input type="text" name="captcha_code" size="10" maxlength="6" /></div> <!-- end #fCaptcha --></div> <div id="fCaptchaBox"></div> <div id="fSubmit"><input type="submit" name="submit" value="Email This Form" /></div> </form> <!-- end #fContainer --></div> <!-- end #main --></div> <!-- end #wrapper --></div> </body> </html> <?php } ?> |