I’m creating a form that will mail in php and I want the users to be able to attach a “.doc” filea before they send the e-mail.
can any one point me in the direction of a script? I tried looking on hotscripts but I don’t know what category it would come under and the search didnt come up with anything i wanted.
Ok I did my best to understand the manual but let me get this right.
PEAR is a wizard/bundle program that contains lots of PHP scripts?
I have downloadeded but told me I have to insert a address into my “include path” which I dont know where that is as I’m running a WAMP testing server?
If you want to send file with mail, you will need mime for as far as i know. its easyer to install the pear from the prompt.
shell>cd /dir/of/pear.bat
shell>run pear.bat
thanks I inserted the script at the top of my form page and saved it as a php. then changed my form enctype to “multipart/form-data”. and method as POST. Also changed
Ok I’ve got this script so far that will use and external mimemail.php script to excecute:
if I include this script:
<?php $mailVars['to'] = $_POST['email'];
$mailVars['toname'] = $_POST['name'];
$mailVars['from'] = [email]yourname@yourdomain.com[/email];
$mailVars['fromname'] = "andrew";
$mailVars['subject'] = "Subject of the message you want to send";
// message
$mailVars['html'] = '<div style="font-family: Verdana, Arial, Helvetica:
11px; color: #0000CC;">Hello Name<br>
<br>
Thank you for filling out the form<br>
<br>
All the best, You<br></div>
';
include_once("mimemail.php");
if (mimemail($mailVars)){
//anything you want to do upon succesful message
} else {
// when sending went wrong;
}
?>
schould I put this at the top of my form page and “name” each input field to correspond with the variable in the php e.g. to, toname, from, from name. although I want to keep to constant?