Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 11-14-2012, 04:30 PM   #1
Join Date: Nov 2012
Posts: 29
Default send job form to email directly

I found this script for send form data to email address with attachment: which value must be replaced to make this script work fine
the idea of my form is when preesed submit then the data send to email like :cv@site.com
with file attachment as a c.v
and user see "thanks your data has been sent"
PHP Code:
// get posted data into local variables
$EmailTo "[EMAIL="email@site.com"]email@site.com[/EMAIL]";
$Subject "A new file was uploaded!";
$email Trim(stripslashes($_POST['email']));
$comments Trim(stripslashes($_POST['comments']));
// prepare email body text
$Body .= "الاسم: ";
$Body .= $name;
$Body .= "\n";
$Body .= "الايميل: ";
$Body .= $email;
$Body .= "\n";
$Body .= "الدوله: ";
$Body .= $country;
$Body .= "\n";
$Body .= "المدينه: ";
$Body .= $city;
$Body .= "\n";
$Body .= "الجوال: ";
$Body .= $mobile;
$Body .= "\n";
$Body .= "تاريخ الميلاد: ";
$Body .= $date;
$Body .= "\n";
$Body .= "الوظيفه: ";
$Body .= $RadioGroup3;
$Body .= "\n";
// ==============
// Configuration
// ==============
$uploaddir "c:\upldr/";
// Where you want the files to upload to
//Important: Make sure this folders permissions is 0777!
$allowed_ext "jpg, JPG, jpeg, gif, docx,doc,txt, pdf";
// These are the allowed extensions of the files that are uploaded
$max_size "10485760";
// 50000 is the same as 50kb
$max_height "6000";
// This is in pixels - Leave this field empty if you don't want to upload images
$max_width "6000";
// This is in pixels - Leave this field empty if you don't want to upload images
// Check Entension
$extension pathinfo($_FILES['file']['name']);
$extension $extension[extension];
$allowed_paths explode(", "$allowed_ext);
$i 0$i count($allowed_paths); $i++) {
if (
$allowed_paths[$i] == "$extension") {
$ok "1";
// Check File Size
if ($ok == "1") {
$_FILES['file']['size'] > $max_size)
"<meta http-equiv=\"refresh\" content=\"0;URL=../upload_ERROR_SIZE\">";
see the attachment
Attached Images
File Type: png photo.png (19.3 KB, 2 views)

Last edited by gentleone; 11-14-2012 at 05:20 PM.. Reason: wrapped in PHP tags
hussam81 is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 04:25 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com