Hi frnds...
i have to do resume uploading to email...plz give me the code for uploading resume to email..
i know the code for sending email..but dont know how to do the attachement....plz tell me...
this is my code(this code only 4 mail..not 4 attachment)...plz change this code for attachment...
<?php
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$name= $fname.' '.$lname;
$edu=$_POST['edu'];
$email=$_POST['email'];
$gender=$_POST['gender'];
$date=$_POST['date'];
$month=$_POST['month'];
$year=$_POST['year'];
$address=$_POST['address'];
$mobile=$_POST['tel'];
[B]$resume=$_FILES['resume']['name'];
$tresume=$_FILES['resume']['tmp_name'];[/B]
$dob=$date.'-'.$month.'-'.$year.'';
$subject="Career";
$message="<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<title>Trails - Inquiry</title>
<style>
<!--
.title{
font-size:18;
font-family:Tahoma;
font-weight:bold;
color:#F78C02;
}
.label{
font-size:14;
font-family:Tahoma;
font-weight:bold;
color:#FBFBFB;
}
.text{
font-size:12;
font-family:Tahoma;
color:#FFFFFF;
}
.outline{
outline: thin solid #FBFBFB;
}
hr{color:#77bc13}
table,tr,td{
font-size:14;
font-family:Tahoma;
color:#000000;
}
-->
</style>
</head>
<body topmargin='0'>
<table width='100%' border='0' cellspacing='1' cellpadding='1' bgcolor='#050505'>
<tr>
<td colspan='3'> </td>
</tr>
<tr>
<td width='15%'> </td>
<td align='center' valign='middle'>
<table width='100%' border='0' cellspacing='2' cellpadding='2' bgcolor='#717171' class='outline'>
<tr>
<td colspan='3' class='title'>Trails Inquiry</td>
</tr>
<tr>
<td colspan='3'><hr></td>
</tr>
<tr>
<td align='left' valign='top' width='8%' class='label'>Name</td>
<td align='left' valign='top' width='1%' class='label'>:</td>
<td align='left' valign='top' width='*' class='text'>".$name."</td>
</tr>
<tr>
<td align='left' valign='top' width='8%' class='label'>Qualification</td>
<td align='left' valign='top' width='1%' class='label'>:</td>
<td align='left' valign='top' width='*' class='text'>".$edu."</td>
</tr>
<tr>
<td align='left' valign='top' class='label'>Gender</td>
<td align='left' valign='top' class='label'>:</td>
<td align='left' valign='top' class='text'>".$gender."</td>
</tr><tr>
<td align='left' valign='top' class='label'>Email</td>
<td align='left' valign='top' class='label'>:</td>
<td align='left' valign='top' class='text'>".$email."</td>
</tr>
<tr>
<td align='left' valign='top' class='label'>Date of Birth</td>
<td align='left' valign='top' class='label'>:</td>
<td align='left' valign='top' class='text'>".$dob."</td>
</tr>
<tr>
<td align='left' valign='top' class='label'>Address</td>
<td align='left' valign='top' class='label'>:</td>
<td align='left' valign='top' class='text'>".$address."</td>
</tr>
<tr>
<td align='left' valign='top' class='label'>Mobile Number</td>
<td align='left' valign='top' class='label'>:</td>
<td align='left' valign='top' class='text'>".$mobile."</td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</td>
<td width='15%'> </td>
</tr>
<tr>
<td colspan='3'> </td>
</tr>
</table>
</body>
</html>";
$to = "TargetName <support@firstyantra.com>";
$host = "mail.aaaaaaaa.com";
$username = "support@aaaaaaa.com";
$password = "support123";
//$messg= 'Subject :'.$subject.'---'.'Name :'.$Name.'Phone :'.$Phone.'---'.'From :'.$from.'---'.'Family :'.$Family.'---'.'Message :'.$message;
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject, 'Name'=>$name,'Qualification'=>$edu,'Gender'=>$gender,'Email'=>$email, 'Date of Birth'=>$dob,'Address'=>$address,'Mobile'=>$mobile);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
header("location:careers.html?msg=Message Successfully sent");
}
?>
Thanks in advance
Sari....