hi i want to send an email with attaching pdf file using php. i have the following script but the problem with this is when i send an attachment it does to the specified address but that email is empty means there is no attachment as well as message. what i am doing wrong in this script help
Code: <form id="requestcv" name="form1" method="post" action="request2.php">
<div>
<label>Your Name:</label>
<input type="text" name="name" id="textfield" />
</div>
<div>
<label>Your Email:</label>
<input type="text" name="email" id="textfield2" />
</div>
<div class="actions">
<input class="actions" type="submit" name="request" id="button" value="Request CV" />
</div>
</form>
<p>
<?php
if($_POST['request'])
{
//echo "My cv has been sent to your email address.Please check your email after 15 minutes. Thank you for requesting my CV.";
$name = $_POST['name'];
$email = $_POST['email'];
$message = "Here is my CV you requested for.Please download attachment and view my cv.Thank you for using my services.";
$to = $email;
$subject = "This is from zafar portfolio";
$random_hash = md5(date('r', time()));
$headers = "From: address@yahoo.comrnReply-To: address@yahoo.com";
$headers .= "rnContent-Type: multipart/mixed; boundary="PHP-mixed-".$random_hash.""";
$attachment = chunk_split(base64_encode(file_get_contents("CV.pdf")));
$output = "
--PHP-mixed-$random_hash;
Content-Type: multipart/alternative; boundary='PHP-alt-$random_hash'
--PHP-alt-$random_hash
Content-Type: text/plain; charset='iso-8859-1'
Content-Transfer-Encoding: 7bit
Hello World!
This is the simple text version of the email message.
--PHP-alt-$random_hash
Content-Type: text/html; charset='iso-8859-1'
Content-Transfer-Encoding: 7bit
<h2>Hello World!</h2>
<p>This is the <b>HTML</b> version of the email message.</p>
--PHP-alt-$random_hash--
--PHP-mixed-$random_hash
Content-Type: application/pdf; name=CV.pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--PHP-mixed-$random_hash--";
//mail($to, $subject, $message, $output, $headers);
if (mail($to, $subject,$message, $output, $headers)) {
echo 'Mail sent';
} else {
echo 'Mail NOT sent';
}
}
?>
image upload, resize THEN submit form
Ok so I have a form that requires the user to upload an image, and then do something with that image (using some ajax scripts), then fill out the rest of the form and submit. I have the upload script
Count on multidimensional array
Hi, i got an array as below:Array( => Array ( [2009-12-08] => 1 ) [1] => Array ( [2009-12-07] => 1 ) [2]
Array disappearing in foreach loop
Okay, I have this problem where an array will become undefined in a foreach loop.Here is the function plus a couple comments:Code: [Select]function mineResources($nation) {global $db;$resources =
News script
Hi ...I am not sure if this is the rite place to post this but if its not sorry i am new here and need help with my cricket scores script now the code works well i just cant get the next or prev to
Xml parsing
I need a suggestion about parsing xml with multiply parts like pervious... i.e. different devices has a similar configuration, but how I can discern it by device? Code: <config><device
Had a simple form script that suddenly stopped working
It was made about a year ago and had been working fine. Last time it was known to work for sure was in early October. I got a message from someone saying they didn't think it work and I tried it
jquery validation in codeIgniter
hai i need to add client side validation to my fiels which are selected in a forloop.the fields are auto incremented according to count.i need to add validation for a selected fields onlymy code is
How to restrict the display of report variants
Hello All,
Php - mysql store data and use it later?
Hi, i' making a login page at the moment, however my username + password is stored many different places, and is kinda hard to get, so I have written this entire code:Code:
first id from db not showing
I have a php script which displays the content of a mysql table as a html table with sorting, delete/update button, etc. the problem is I can't make it show the first value inserted in the db, it only