Jump to content

[SOLVED] Sending an email with an attachment


craigtolputt

Recommended Posts

Hi Guys,

 

I think this is possible but im not sure....

 

Can i have a flash form with an upload your photo button, then they browse for their photo and click send.  Then the form data and photo are sent to an email address??

 

I have the form working fine i just need the code to add the image as an attachment.

 

Anyone know any good tuts or have any info on this?

 

this is my php mail sender...

 

<?php

$category = $_REQUEST["passenger1"];
$person = $_REQUEST["passenger2"];
$team = $_REQUEST["passenger3"];
$employer = $_REQUEST["passenger4"];
$yesno = $_REQUEST["passenger5"];
$nominator = $_REQUEST["passenger6"];
$jobtitle = $_REQUEST["passenger7"];
$address = $_REQUEST["passenger8"];
$postcode = $_REQUEST["passenger9"];
$phone = $_REQUEST["passenger10"];
$email = $_REQUEST["passenger11"];
$thedate = $_REQUEST["passenger12"];
$sign = $_REQUEST["passenger13"];
$nomineerole = $_REQUEST["passenger14"];
$achievements = $_REQUEST["passenger15"];
$why = $_REQUEST["passenger16"];
$evidence = $_REQUEST["passenger17"];
$subject = $_REQUEST["subject"];

// include sender IP in the message.
$full_message = $_SERVER['REMOTE_ADDR'] . "\n\n" . "Cats 2008 Online Nomination Details" . "\n\n" . "Award Category:  " . $category . "\n\n" . "Person/team being nomiated:  " . $person . "\n\n" . "Nominee's job title/team name:  " . $team . "\n\n" . "Employer (company/organisation):  " . $employer . "\n\n" . "Does the nominee know they have been nominated:  " . $yesno . "\n\n" . "Nominator's name: \n\n" . $nominator . "\n\n" . "Your job title: \n\n" .  $jobtitle . "\n\n" . "Your contact address: \n\n" . $address . "\n\n" . "Postcode:  " . $postcode . "\n\n" . "Your contact telephone:  " . $phone . "\n\n" . "Your email:  " . $email . "\n\n" . "Date:  " . $thedate . "\n\n" . "Signature:  " . $sign . "\n\n\n------------------------------------------------------------------------------------------------------\n\n\n" . "1. Describe fully the nominee’s role / current position and indicate the length of time the nominee has been employed. Please give
general details if nomination is for a team:\n\n  " . $nomineerole . "\n\n" . "2. Describe the nominee’s achievements over their period of employment, including both training / educational achievements, and
any other relevant accomplishments or successes:\n\n  " . $achievements . "\n\n" . "3. Explain WHY you believe the nominee should win this award, and HOW they meet the specified criteria?:\n\n  " . $why . "\n\n" . "4. Please list any specific examples or evidence you have to support this nomination, e.g.
• Letters from customers • Statements from work colleagues • Press cuttings • Certificates • Menus • Photographs:\n\n  " . $evidence;
$message= $full_message;

// remove the backslashes that normally appears when entering " or '
$message = stripslashes($message); 
$subject = stripslashes($subject); 
$sender = stripslashes($sender); 

// send the email, make sure you replace [email protected] with your email address
if(isset($message) and isset($subject) and isset($sender)){
mail("[email protected]", $subject, $message, "From: $email");
}
?>

 

cheers

 

Craig

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.