Jump to content

Attaching an image from database to email


dc_jt

Recommended Posts

Hi

I
have a form which when submitted is emailed to a certain email address. However I would like to attach the image which is submitted from the user to the email but havent got a clue how.

Anyone know how i put it into my email code?

Thanks


[code]if(sizeof($_REQUEST[errors])<1)
{
//if no errors then execute application

$oReaders = new RCLTblReaders();
if (!$oReaders->AddReader($_POST))
{
$_REQUEST['errors']['db'] = 'Please check your details again</div>';
}
$_REQUEST[mode]="complete";



$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$address=$_REQUEST['address1'];
$town=$_REQUEST['town'];
$city=$_REQUEST['city'];
$postcode=$_REQUEST['postcode'];
$country=$_REQUEST['country'];
$license=$_REQUEST['license'];
$memory=$_REQUEST['memory'];
$photo=$_REQUEST['photo'];
$datap=$_REQUEST['datap'];

$to      = "***@***.com";
$subject = "Readers Archive";
$message = 'Name: ' .$name."\n". 'Email: '.$email."\n". 'Address: '.$address."\n". 'Town: '.$town."\n". 'City: '.$city."\n".'Postcode:'.$postcode."\n".'Country: '.$country."\n".'Photo:'.$photo;

$from =  'From: ***@***.com';
mail($to, $subject, $message, $from);
mail("***@***.com", $subject, $message, $from);


}
}
?>
<?php
if ($_REQUEST['mode'] == 'complete')
{
echo 'Thank You for submitting your details.';

}
else
{
?>

<? if($_REQUEST[errors]){
?>

<ul>
<?
foreach($_REQUEST[errors] as $error){echo $error;}
?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.