Quote:
Originally Posted by deepaks85
I really appreciate your reply sir. But it is still not working for me......the email message is still in constantly one line...Below is the example
[HTML]Sendor Information Name: Deepak Saxena Office: Onlineres Email: deepaks85@gmail.com Extn.: 18185748468 Project name: Syrian air project Media type: Web Project type: Print Banner Size: Height = 34 inch, Width = 34 inch Color: Limited colors Due date: 4 March, 2007 Time by: 5 Hrs 4 MinsIST Description: Please send to me. Number of files: 3 Quality/Resolution of files: High resolution Output format: PDF: Yes JPG: Yes GIF: No PSD: Yes OTHERS: No[/HTML]
Here is the code again:
[PHP]<?
include 'mail_attachment.php';
# Is the OS Windows or Mac or Linux
if (strtoupper(substr(PHP_OS,0,3)=='WIN')) {
$eol="\r\n";
} elseif (strtoupper(substr(PHP_OS,0,3)=='MAC')) {
$eol="\r";
} else {
$eol="\n";
}
if (!$_POST['newproject'])
$errors[] = "Project name is required";
else
$newproject = $_POST['newproject'];
// if there are any errors, display them
if (count($errors)>0) {
foreach($errors as $err)
echo "$err<br>\n";
echo "<br>Please use your browser's Back button to fix.";
} else {
// no errors, so we build our message
$to = "deepaks85@gmail.com";
$subject = "Your request";
$from = stripslashes($_POST['email']);
$msg = "Sendor Information".$eol;
$msg.= $eol."Name: ".$_POST['fname']." ".$_POST['lname'];
$msg.= $eol."Office: ".$_POST['office'];
$msg.= $eol."Email: ".$_POST['email'];
$msg.= $eol."Extn.: ".$_POST['extn'];
$msg.= $eol."Project name: ".$newproject;
$msg.=$eol."Media type: ".$_POST['media'];
switch($_POST['project_type']){
case 'web_banner':
$proj_type = "Web Banner";
break;
case 'print_banner':
$proj_type = "Print Banner";
break;
case 'flyer':
$proj_type = "Flyer";
break;
case 'invitation':
$proj_type = "Invitation";
break;
case 'program':
$proj_type = "Program";
break;
case 'other':
$proj_type = $_POST['other'];
break;
default:
$proj_type = " ";
}
$msg.=$eol."Project type: ".$proj_type;
$msg.=$eol."Size: Height = ".$_POST['height']." ".$_POST['dimension'].", Width = ".$_POST['width']." ".$_POST['dimension'];
$msg.=$eol."Color: ".$_POST['color'];
switch($_POST['month']){
case '1':
$month = "January";
break;
case '2':
$month = "February";
break;
case '3':
$month = "March";
break;
case '4':
$month = "April";
break;
case '5':
$month = "May";
break;
case '6':
$month = "June";
break;
case '7':
$month = "July";
break;
case '8':
$month = "August";
break;
case '9':
$month = "September";
break;
case '10':
$month = "October";
break;
case '11':
$month = "November";
break;
case '12':
$month = "December";
break;
default:
$month = " ";
}
$msg.=$eol."Due date: ".$_POST['date']." ".$month.", ".$_POST['year'];
$msg.=$eol."Time by: ".$_POST['hours']." Hrs ".$_POST['minutes']." Mins".$_POST['standard'];
$msg.=$eol."Description: ".stripslashes($_POST['description'])."\n";
$msg.=$eol."Number of files: ".$_POST['files'];
$msg.=$eol."Quality/Resolution of files: ".$_POST['quality'];
$pdf=($_POST['PDF'])?"PDF: Yes":"PDF: No";
$jpg=($_POST['JPG'])?"JPG: Yes":"JPG: No";
$gif=($_POST['GIF'])?"GIF: Yes":"GIF: No";
$psd=($_POST['PSD'])?"PSD: Yes":"PSD: No";
$others=($_POST['OTHERS'])?"OTHERS: Yes".$_POST['out_format']:"OTHERS: No";
$msg.=$eol."Output format:\n\n$pdf\n$jpg\n$gif\n$psd\n$others\n";
mail_attachment($from, $to, $subject, $msg, 'dhd.gif');
}
?>[/PHP]