0

I have 12 field form
One field is file (How to validate for .doc, .docx, .pdf)

How to send all information and file as email?

I found complicated codes. Can anybody help with simple one?

4
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by vizz
0

A Simple methode is

upload your file to your server location and take that uploaded file path.
Attach this filepath to your mail content for download this file.

0
mail($to,$subject,$message,$headers);

How to include filepath to this code?

0

Exg:

<?php
$txtName=$_POST['txtName'];
$txtEmail=$_POST['txtEmail'];
$fileName=$_POST['fileName'];
$txtIndustry=$_POST['txtIndustry'];
$txtCountry=$_POST['txtCountry'];
$txtCompensation=$_POST['txtCompensation'];
$currentPage=$_POST['currentpage'];
$host=$_SERVER['HTTP_HOST'];
$download='<tr><td colspan="2">Downloads: <a href="http://'.$host.'/filepath/'.$fileName.'"  target="_blank" >'.$fileName.'</a></td></tr>';


$enquiry='<table width=700 border=0 cellspacing=2 cellpadding=2 align=center>
<tr><td align=right width=100>Name: </td><td>'.$txtName.'</td></tr>
<tr><td align=right width=100>Email: </td><td>'.$txtEmail.'</td></tr>
<tr><td align=right width=100>Industry: </td><td>'.$txtIndustry.'</td></tr>
<tr><td align=right width=200>Preferred Country: </td><td>'.$txtCountry.'</td></tr>
<tr><td align=right width=200>Expected Compensation: </td><td>'.$txtCompensation.'</td></tr>
'.$download.'
</table>';

$headers = "MIME-Version: 1.0" . "\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";

$headers .= "From:info@your.com\r\n";

$user="info@your.com";

mail($user,"Your Web Info", $enquiry, $headers);

?>
0

Bachov Varghese

Thanks
This code works fine

Can anyone help me to submit above info using jQuery?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.