Jump to content

Emailing A Form


enemeth

Recommended Posts

Simple !

 

get the PHPMailer, search in google to download it.

 

put the files in a folder,

create a file, say emailme.php, for mailing the contents

inlcude the class.phpmailer.php on the first line

 

instantiate the object like this

 

$mail = new PHPMailer();

$mail->IsHTML(true);

$mail->IsSMTP(); // telling the class to use SMTP

$mail->Host = "localhost"; // SMTP server

$mail->From = "the persons email address here, this is the person who fills the form";

$mail->FromName = 'his display name'; // the username, this you can get from the $_POST['firstname'] depending on how you design the form';

 

you can also copy the above code to the file after the inlcude code.

 

store the values of the form using the Post methos to the variable or the array

 

create an html page, say content.html, you need not save this page also, are you using dreamweaver  or frontpage ?.. what ever it is, create the format of how you want the email to be.

place the variable name or the array name on the area where you want to display the value of the form

 

example

First name  -  <?=$fname?>  or if its array First name <?=$arr_vars[0]?>

 

Last neme  <?=lname?>

 

etcetra....

 

after you finished designing the page, select all, then copy it

 

come to the emaime.php

create a variable, say $body,

$body = '( copy thecontents here)'  within the quotes,

 

make sure the php variables are concatenated properly.

 

assign the $boby to

$mail->Body = $body

then

$mail->Subject = 'Subect here'

 

then .. you are finished

 

$mail->Send();

 

upto you to handle the error

 

............................................................

 

this will help you only if you know something about php and already worked with php...

 

~J

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.