Menu
I am using the mailer.php to email results from a form, but it doesnt email the attachments for people to attatch files, can it be changed or somthing added to the code so that it can email the atatchments or is there a simple code similar to the mailer.php that I can use?
I dont know much about editing php like what to change…i have tried heaps of them but i dont know if i am changing the right fields to get it to work…if someone could help me out here it would be great.
matt
[CODE]
<table width="55%" height="555" border="0" align="center">
<tr>
<td height="137" colspan="4"> <div align="center"><img src="files/topbar1.gif" name="image1" width="795" height="133" border="0" align="absmiddle" usemap="#Map" id="image1"></div></td>
</tr>
<tr>
<td width="24%" height="153"> </td>
<td height="75" colspan="2" class="text">
<form action="application1.htm" method="post" enctype="multipart/form-data" name="form1">
<p> </p>
<p> </p>
<table width="94%">
<tr>
<td class="text">Surname</td>
<td height="38" class="text"> <p>
<input name="Surname2" size="15" type="text">
</p></td>
<td class="text">Given</td>
<td height="38" class="text"> <input name="Given2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">D.O.B.</td>
<td height="40" class="text"> <input name="DOB2" type="text" id="DOB4" size="15"></td>
<td height="40" class="text">Sex</td>
<td height="40" class="text"> <select size="1" name="select">
<option selected="selected">Male</option>
<option>Female</option>
</select></td>
</tr>
<tr>
<td class="text">Address</td>
<td height="40" class="text"> <input name="address2" size="25" type="text"></td>
<td height="40" class="text">Suburb</td>
<td height="40" class="text"> <input name="Suburb2" type="text" id="Suburb3" size="15"></td>
</tr>
<tr>
<td class="text">Postcode</td>
<td height="35" class="text"> <input name="pc2" type="text" id="pc" size="15"></td>
<td height="35" class="text">State</td>
<td height="35" class="text"> <select size="1" name="select">
<option selected>SA</option>
<option>NT</option>
<option>NSW</option>
<option>QLD</option>
<option>TAS</option>
<option>VIC</option>
<option>WA</option>
</select></td>
</tr>
<tr>
<td class="text">Country </td>
<td height="37" class="text"> <input name="Country2" size="15" value="Australia" type="text"></td>
<td height="37" class="text">Resident </td>
<td height="37" class="text"> <select size="1" name="select">
<option selected="selected">Yes</option>
<option>No</option>
</select></td>
</tr>
<tr>
<td class="text">Phone(H) </td>
<td height="35" class="text"> <p>
<input name="Phoneh2" size="15" type="text">
</p></td>
<td height="35" class="text">Phone(M)</td>
<td height="35" class="text"> <input name="Phonem2" size="15" type="text"></td>
</tr>
<tr>
<td class="text"><p>Nationality </p></td>
<td height="34" class="text"> <input name="nationality" type="text" id="nationality" size="15"></td>
<td height="34" class="text">Tax File #</td>
<td height="34" class="text"> <input name="tfn2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Height</td>
<td height="-2" class="text"><input name="height2" size="5" type="text">
cm </td>
<td height="-2" class="text">Police record</td>
<td height="-2" class="text"><select size="1" name="select">
<option>Yes</option>
<option selected="selected">No</option>
</select></td>
</tr>
<tr>
<td class="text">Visa Required</td>
<td height="-2" class="text"><select size="1" name="select">
<option>Yes</option>
<option selected="selected">No</option>
</select></td>
<td height="-2" class="text">Transport</td>
<td height="-2" class="text"><select size="1" name="select">
<option selected="selected">Yes</option>
<option>No</option>
</select></td>
</tr>
<tr>
<td class="text">Visa #</td>
<td height="-2" class="text"><input name="visanum2" size="15" type="text"></td>
<td height="-2" class="text">Exp. Date</td>
<td height="-2" class="text"><input name="visaexpire2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Job Seeker ID</td>
<td height="-2" class="text"><input name="jsid2" size="15" type="text"></td>
<td height="-2" class="text">Position Type</td>
<td height="-2" class="text"><input name="position2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Email</td>
<td height="36" colspan="3" class="text"> <input name="email2" size="35" type="text"></td>
</tr>
<tr>
<td class="text"> <div align="left">
<p>Resume (C.V.)</p>
</div></td>
<td height="34" colspan="3" class="text"><b><font color="#993300" size="2">
<input name="resume" type="file" id="resume" >
</font></b></td>
</tr>
<tr>
<td class="text"><p>Comments</p>
<p> </p>
<p> </p></td>
<td height="-2" colspan="3" class="text"><b><font color="#993300" size="2">
<textarea rows="4" name="textarea" cols="40"></textarea>
</font></b></td>
</tr>
<tr>
<td class="text"> </td>
<td height="30" colspan="3" class="text"> <div align="right">
<input name="Submit2" type="submit" value="Submit">
</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
</table>
<p> </p>
</form>
<p align="center"><br>
</p>
</td>
<td width="23%" height="75"><p align="center" class="text"> </p></td>
</tr>
<tr>
<td height="24" colspan="4"><div align="center"><font color="#999999" size="-7" face="Century Gothic">copyright
montica 2006</font></div></td>
</tr>
</table>
[/CODE]
[CODE]
<table width="55%" height="555" border="0" align="center">
<tr>
<td height="137" colspan="4"> <div align="center"><img src="files/topbar1.gif" name="image1" width="795" height="133" border="0" align="absmiddle" usemap="#Map" id="image1"></div></td>
</tr>
<tr>
<td width="24%" height="153"> </td>
<td height="75" colspan="2" class="text">
<?php
/* --------------------------------------------------
This example shows how to use the class to get an
attachment from a user and send it via email.
e.g., a job site where a prospect is sending
resume.
-------------------------------------------------- */
include "MIME.class";
define('TO', '[email protected]'); # CHANGE THIS TO A REAL ADDRESS (yours?)
// Has there been a form submission? If yes, go on and
// process...
if (is_array($HTTP_POST_VARS)) {
if ($resume != 'none') {
$fname = './'.$resume_name; // make a real filename
// Get the content-type of the uploaded file
if (preg_match("!/x-.+!i", $resume_type))
$type = OCTET;
else
$type = $resume_type;
$from = sprintf("'%s' <%s>", $name, $email) ;
copy($resume, $fname); //do error checking if need
$mime = new MIME_mail($from, TO, 'Resume', "Please find attached my resume", "Cc: $email");
$mime->fattach($fname, "Resume of $name", $type);
$mime->send_mail();
echo "Dear $name<p>Your resume has been emailed and a copy sent to you<br>";
unlink($resume); // remove the uploaded file
} else {
echo "Dear $name<p>You have not submitted your resume. Please use the browse button to attach it and click send!<br>";
}
}
?>
<form action="<?php echo $PHP_SELF;?>" method="post" enctype="multipart/form-data" name="form1">
<p> </p>
<p> </p>
<table width="94%">
<tr>
<td class="text">Surname</td>
<td height="38" class="text"> <p>
<input name="Surname2" size="15" type="text">
</p></td>
<td class="text">Given</td>
<td height="38" class="text"> <input name="Given2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">D.O.B.</td>
<td height="40" class="text"> <input name="DOB2" type="text" id="DOB4" size="15"></td>
<td height="40" class="text">Sex</td>
<td height="40" class="text"> <select size="1" name="select">
<option selected="selected">Male</option>
<option>Female</option>
</select></td>
</tr>
<tr>
<td class="text">Address</td>
<td height="40" class="text"> <input name="address2" size="25" type="text"></td>
<td height="40" class="text">Suburb</td>
<td height="40" class="text"> <input name="Suburb2" type="text" id="Suburb3" size="15"></td>
</tr>
<tr>
<td class="text">Postcode</td>
<td height="35" class="text"> <input name="pc2" type="text" id="pc" size="15"></td>
<td height="35" class="text">State</td>
<td height="35" class="text"> <select size="1" name="select">
<option selected>SA</option>
<option>NT</option>
<option>NSW</option>
<option>QLD</option>
<option>TAS</option>
<option>VIC</option>
<option>WA</option>
</select></td>
</tr>
<tr>
<td class="text">Country </td>
<td height="37" class="text"> <input name="Country2" size="15" value="Australia" type="text"></td>
<td height="37" class="text">Resident </td>
<td height="37" class="text"> <select size="1" name="select">
<option selected="selected">Yes</option>
<option>No</option>
</select></td>
</tr>
<tr>
<td class="text">Phone(H) </td>
<td height="35" class="text"> <p>
<input name="Phoneh2" size="15" type="text">
</p></td>
<td height="35" class="text">Phone(M)</td>
<td height="35" class="text"> <input name="Phonem2" size="15" type="text"></td>
</tr>
<tr>
<td class="text"><p>Nationality </p></td>
<td height="34" class="text"> <input name="nationality" type="text" id="nationality" size="15"></td>
<td height="34" class="text">Tax File #</td>
<td height="34" class="text"> <input name="tfn2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Height</td>
<td height="-2" class="text"><input name="height2" size="5" type="text">
cm </td>
<td height="-2" class="text">Police record</td>
<td height="-2" class="text"><select size="1" name="select">
<option>Yes</option>
<option selected="selected">No</option>
</select></td>
</tr>
<tr>
<td class="text">Visa Required</td>
<td height="-2" class="text"><select size="1" name="select">
<option>Yes</option>
<option selected="selected">No</option>
</select></td>
<td height="-2" class="text">Transport</td>
<td height="-2" class="text"><select size="1" name="select">
<option selected="selected">Yes</option>
<option>No</option>
</select></td>
</tr>
<tr>
<td class="text">Visa #</td>
<td height="-2" class="text"><input name="visanum2" size="15" type="text"></td>
<td height="-2" class="text">Exp. Date</td>
<td height="-2" class="text"><input name="visaexpire2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Job Seeker ID</td>
<td height="-2" class="text"><input name="jsid2" size="15" type="text"></td>
<td height="-2" class="text">Position Type</td>
<td height="-2" class="text"><input name="position2" size="15" type="text"></td>
</tr>
<tr>
<td class="text">Email</td>
<td height="36" colspan="3" class="text"> <input name="email2" size="35" type="text"></td>
</tr>
<tr>
<td class="text"> <div align="left">
<p>Resume (C.V.)</p>
</div></td>
<td height="34" colspan="3" class="text"><b><font color="#993300" size="2">
<input name="resume" type="file" id="resume" >
</font></b></td>
</tr>
<tr>
<td class="text"><p>Comments</p>
<p> </p>
<p> </p></td>
<td height="-2" colspan="3" class="text"><b><font color="#993300" size="2">
<textarea rows="4" name="textarea" cols="40"></textarea>
</font></b></td>
</tr>
<tr>
<td class="text"> </td>
<td height="30" colspan="3" class="text"> <div align="right">
<input name="Submit2" type="submit" value="Submit">
</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
</table>
<p> </p>
</form>
<p align="center"><br>
</p>
</td>
<td width="23%" height="75"><p align="center" class="text"> </p></td>
</tr>
<tr>
<td height="24" colspan="4"><div align="center"><font color="#999999" size="-7" face="Century Gothic">copyright
montica 2006</font></div></td>
</tr>
</table>
[/CODE]
0.1.9 — BETA 5.1