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'>&nbsp;</td>
  </tr>
  <tr>
    <td  width='15%'>&nbsp;</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>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>

</table>	
	</td>
    <td  width='15%'>&nbsp;</td>
  </tr>
  <tr>
    <td colspan='3'>&nbsp;</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....

Recommended Answers

All 3 Replies

Hello ivatanako,

Thanks for ur quick reply...

In this i have some doubts..here first we move the file into folder????
where is the attachment file stored? plz explain clearly...

Thanks...

As you might see on most email systems like yahoo! and gmail. It requires you to upload the file itself then it sends this data.

So to your question, "where is the file stored?" it depends on where the upload stores this files.

Hope that shed some light on your doubts.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.