PHP - File Attachment Php Mail()
Hi Guys,
Please can someone shred some light on what im doing wrong. Upon form submission it takes you to the success page. It then grabs the data, emails it through to the owner as a HTML email and then attaches 2 file attachments. The issue I am having is the attachments appear BUT they will not open. Its as though the files are corrupt. Part of the form is as follows: Code: [Select] CV: <input name="fileAttach[]" type="file" class="field" /> ID: <input name="fileAttach[]" type="file" class="field" /> The PHP is as follows: (please ignore most of the HTML body content from the email, the attachment bit is at the bottom) Code: [Select] <?php // Grab Data from Form if(isset($_POST['submit'])) { // Personal Information $surname = mysql_real_escape_string($_POST['surname']); $firstname = mysql_real_escape_string($_POST['firstname']); $telephone = mysql_real_escape_string($_POST['telephone']); $mobile = mysql_real_escape_string($_POST['mobile']); $email = mysql_real_escape_string($_POST['email']); $address = mysql_real_escape_string($_POST['address']); $postcodep1 = mysql_real_escape_string($_POST['postcodep1']); $postcodep2 = mysql_real_escape_string($_POST['postcodep2']); $dob_dd = mysql_real_escape_string($_POST['dob_dd']); $dob_mm = mysql_real_escape_string($_POST['dob_mm']); $dob_yyyy = mysql_real_escape_string($_POST['dob_yyyy']); // Next of Kin $nextkinname = mysql_real_escape_string($_POST['nextkinname']); $nextkintel = mysql_real_escape_string($_POST['nextkintel']); // Availability $days_mon = mysql_real_escape_string($_POST['days_mon']); $days_tue = mysql_real_escape_string($_POST['days_tue']); $days_wed = mysql_real_escape_string($_POST['days_wed']); $days_thu = mysql_real_escape_string($_POST['days_thu']); $days_fri = mysql_real_escape_string($_POST['days_fri']); $days_sat = mysql_real_escape_string($_POST['days_sat']); $days_sun = mysql_real_escape_string($_POST['days_sun']); $availability_am = mysql_real_escape_string($_POST['availability_am']); $availability_pm = mysql_real_escape_string($_POST['availability_pm']); $availability_allday = mysql_real_escape_string($_POST['availability_allday']); $availability_requirements = mysql_real_escape_string($_POST['availability_requirements']); // Experience $experience = mysql_real_escape_string($_POST['experience']); // Rates $rate = mysql_real_escape_string($_POST['rate']); $rate_specific = mysql_real_escape_string($_POST['rate_specific']); // Employer Ref $employrefname = mysql_real_escape_string($_POST['employrefname']); $employrefcomp = mysql_real_escape_string($_POST['employrefcomp']); $employreftel = mysql_real_escape_string($_POST['employreftel']); $employrefadd = mysql_real_escape_string($_POST['employrefadd']); // Personal Ref $persrefname = mysql_real_escape_string($_POST['persrefname']); $persreftel = mysql_real_escape_string($_POST['persreftel']); $persrefadd = mysql_real_escape_string($_POST['persrefadd']); // Extra Information $allergy = mysql_real_escape_string($_POST['allergy']); $allergy_details = mysql_real_escape_string($_POST['allergy_details']); $drive = mysql_real_escape_string($_POST['drive']); $car = mysql_real_escape_string($_POST['car']); $criminal = mysql_real_escape_string($_POST['criminal']); $criminal_details = mysql_real_escape_string($_POST['criminal_details']); $howlongworkuk = mysql_real_escape_string($_POST['howlongworkuk']); $police_check = mysql_real_escape_string($_POST['police_check']); $right2work = mysql_real_escape_string($_POST['right2work']); $right2workna = mysql_real_escape_string($_POST['right2workna']); //*** Uniqid Session ***// $strSid = md5(uniqid(time())); // Email Options $subject = "XXX Job Application"; $to = "test@test.com"; $mailheader = ""; $mailheader .= "From: $email" . "\r\n"; // Applicants copy $mailheader .= "BCc: $email" . "\r\n"; $mailheader .= "MIME-Version: 1.0\n"; $mailheader .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"\n\n"; $mailheader .= "This is a multi-part message in MIME format.\n"; $mailheader .= "--".$strSid."\n"; $mailheader .= "Content-type: text/html; charset=utf-8\n"; $mailheader .= "Content-Transfer-Encoding: 7bit\n\n"; // Message Content $body = '<html><head><style media="all" type="text/css">.table{background-color:#d8f0f8; cellpadding:3; cellspacing:10; border:10; width:625; bordercolor:#d8f0f8; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; padding:5;} .field{margin-left: 5px; margin-right:5px; padding:8px;}</style></head><body>'; $body .= '<table class="table"> <tr> <td colspan="5"> <h2 style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1.3em; margin: 0; text-transform: uppercase; padding-bottom: 10px;">Cleaner Details</h2> </td></tr> <tr> <td></td> <td width="50%" >NAME:</td> <td></td> <td width="50%" >DATE OF BIRTH:</td> <td></td> </tr> <tr class="input"> <td></td> <td bgcolor="#FFFFFF" bordercolor="#666666" class="field">' . strip_tags($_POST['firstname']) . ' ' . strip_tags($_POST['surname']) . '</td> <td></td> <td bgcolor="#FFFFFF" bordercolor="#666666" class="field">' . strip_tags($_POST['dob_dd']) . '/' . strip_tags($_POST['dob_mm']) . '/' . strip_tags($_POST['dob_yyyy']) . '</td> <td></td> </tr> <tr class="field"> <td></td> <td>ADDRESS:</td> <td></td> <td>TELEPHONE:</td> <td></td> </tr> <tr class="input"> <td></td> <td rowspan="3" bgcolor="#FFFFFF" bordercolor="#666666" class="field">' . strip_tags($_POST['address']) . ' ' . strip_tags($_POST['postcodep1']) . ' ' . strip_tags($_POST['postcodep2']) . '</td> <td></td> <td bgcolor="#FFFFFF" bordercolor="#666666" class="field">' . strip_tags($_POST['telephone']) . '</td> <td></td> </tr> <tr class="input"> <td></td> <td></td> <td>MOBILE:</td> <td></td> </tr> <tr class="input"> <td></td> <td></td> <td bgcolor="#FFFFFF" bordercolor="#666666" class="field">' . strip_tags($_POST['mobile']) . '</td> <td></td> </tr> <tr > <td></td> <td colspan=3>EMAIL:</td> <td></td> </tr> <tr > <td></td> <td colspan=3 bgcolor=#FFFFFF bordercolor=#666666 class="field">' . strip_tags($_POST['email']) . '</td> <td></td> </tr> <tr> <td colspan=5><h2 style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1.3em; margin: 0; text-transform: uppercase; padding-bottom: 5px; padding-top: 10px;">EMERGENCY CONTACT INFORMATION</h2></td> </tr> <tr> <td colspan=5 class="field"><hr size=1 /></td> </tr> <tr> <td></td> <td >NAME:</td> <td></td> <td >TELEPHONE:</td> <td></td> </tr> <tr > <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 class="field">' . strip_tags($_POST['nextkinname']) . '</td> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 class="field">' . strip_tags($_POST['nextkintel']) . '</td> <td></td> </tr> <tr> <td colspan=5><h2 style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1.3em; margin: 0; text-transform: uppercase; padding-bottom: 5px; padding-top: 10px;">EXPERIENCE</h2></td> </tr> <tr> <td colspan=5><hr size=1 /></td> </tr> <tr> <td></td> <td colspan="3" bgcolor=#FFFFFF bordercolor=#666666 class="field">' . strip_tags($_POST['experience']) . '</td> <td></td> </tr> <tr> <td></td> <td>CLEANERS RATE:</td> <td></td> </tr> <tr> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 class="field">' . strip_tags($_POST['rate']) . ' ' . strip_tags($_POST['rate_specific']) . '</td> <td></td> </tr> <tr> <td colspan=5><hr size=1 /></td> </tr> <tr> <td colspan=5><h2 style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1.3em; margin: 0; text-transform: uppercase; padding-bottom: 5px; padding-top: 10px;">AVAILABILITY</h2></td> </tr> <tr> <td></td> <td >WEEKDAYS:</td> <td></td> <td >SPECIFIC REQUIREMENTS:</td> <td></td> </tr> <tr> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top >Monday: ' . strip_tags($_POST['days_mon']) . '<br /> Tuesday: ' . strip_tags($_POST['days_tue']) . '<br /> Wednesday: ' . strip_tags($_POST['days_wed']) . '<br /> Thursday: ' . strip_tags($_POST['days_thu']) . '<br /> Friday: ' . strip_tags($_POST['days_fri']) . '<br /> Saturday: ' . strip_tags($_POST['days_sat']) . '<br /> Sunday: ' . strip_tags($_POST['days_sun']) . '<br /> <br /> I am available on the above days in the:<br /> <br /> Morning: ' . strip_tags($_POST['availability_am']) . '<br /> Afternoon: ' . strip_tags($_POST['availability_pm']) . '<br /> All Day: ' . strip_tags($_POST['availability_allday']) . '<br /> </td> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['availability_requirements']) . '</td> <td></td> </tr> <tr> <td colspan=5><hr size=1 /></td> </tr> <tr> <td colspan=5><h2 style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1.3em; margin: 0; text-transform: uppercase; padding-bottom: 5px; padding-top: 10px;">REFERENCES</h2></td> </tr> <tr> <td></td> <td><b>EMPLOYER REFERENCE</b></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td>NAME:</td> <td></td> <td>COMPANY:</td> <td></td> </tr> <tr> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['employrefname']) . '</td> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['employrefcomp']) . '</td> <td></td> </tr> <tr> <td></td> <td>ADDRESS:</td> <td></td> <td>TELEPHONE:</td> <td></td> </tr> <tr> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['employrefadd']) . '</td> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['employreftel']) . '</td> <td></td> </tr> <tr> <td></td> <td><b>PERSONAL REFERENCE</b></td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td>NAME:</td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['persrefname']) . '</td> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td>ADDRESS:</td> <td></td> <td>TELEPHONE:</td> <td></td> </tr> <tr> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['persrefadd']) . '</td> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['persreftel']) . '</td> <td></td> </tr> <tr> <td colspan=5><hr size=1 /></td> </tr> <tr> <td colspan=5><h2 style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 1.3em; margin: 0; text-transform: uppercase; padding-bottom: 5px; padding-top: 10px;">OTHER INFORMATION</h2></td> <tr> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top> Police Check Complete: ' . strip_tags($_POST['police_check']) . '<br /> Criminal Convictions: ' . strip_tags($_POST['criminal']) . ' ' . strip_tags($_POST['criminal_details']) . '<br /> Right to Work: ' . strip_tags($_POST['right2work']) . '<br /> Not Applicable: ' . strip_tags($_POST['right2workna']) . '<br /> Worked in the UK: ' . strip_tags($_POST['howlongworkuk']) . '<br /> </td> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top> Allergies: ' . strip_tags($_POST['allergy']) . ' ' . strip_tags($_POST['allergy_details']) . '<br /> Drive? ' . strip_tags($_POST['drive']) . '<br /> Car? ' . strip_tags($_POST['car']) . ' </td> <td></td> </tr> <tr> <td></td> <td>SIGNED BY CLEANER:</td> <td></td> <td>DATE:</td> <td></td> </tr> <tr> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top> X </td> <td></td> <td bgcolor=#FFFFFF bordercolor=#666666 valign=top> </td> <td></td> </tr> </tr> <tr><td></td><td></td><td></td></tr> </table>'; $body .= "</body></html>"; // Upload Attachments for($i=0;$i<count($_FILES["fileAttach"]["name"]);$i++) { if($_FILES["fileAttach"]["name"][$i] != "") { $mailheader .= $body ."\n\n"; $FilesName = $_FILES["fileAttach"]["name"][$i]; $Content = chunk_split(base64_encode(file_get_contents($_FILES["fileAttach"]["tmp_name"][$i]))); $mailheader .= "--".$strSid."\n"; $mailheader .= "Content-Type: application/octet-stream; name=\"".$FilesName."\"\n"; $mailheader .= "Content-Transfer-Encoding: base64\n"; $mailheader .= "Content-Disposition: attachment; filename=\"".$FilesName."\"\n\n"; $mailheader .= $Content."\n\n"; } } // End of Email Content > Display Message echo "Thank you. Your application was submitted to us successly. We review all applications carefully and we may contact you shortly."; // Attempt to Send Email mail($to, $subject, $body, $mailheader); } else { echo "Application Failed. Unfortunatley, there was a problem with your application and it was not submitted. Please try again later or alternativley please contact us."; } ?> Any help would be much appreicated. Thanks guys! Sam Similar TutorialsHello, Can someone help me with these contact-form please, I just want to include a file (.pdf, .jpg, .png) and send the mail.
For the moment, the mail is send but not with the file included.
Here is the website http://www.coeuraprendre.art
HTML CODE :
<form id="contact-form" class="checkform" action="#" target="contact-send.php" method="post" enctype="multipart/form-data" > <div class="form-row clearfix"> <label for="name" class="req">Nom *</label> <input type="text" name="name" class="name" id="name" value="" placeholder="Name" /> </div> <div class="form-row clearfix"> <label for="email" class="req">Email *</label> <input type="text" name="email" class="email" id="email" value="" placeholder="Email"/> </div> <div class="form-row clearfix textbox"> <label for="message" class="req">Nom du projet *</label> <textarea name="message" class="message" id="message" rows="15" cols="50" placeholder="Message"></textarea> </div> <div class="form-row clearfix"> <label for="pdf" class="req">Ajoutez votre dossier d'inscription (Pdf intéractif) *</label> <input type="file" id="pdf" class="pdf" name="pdf" placeholder="Pdf" accept="image/pdf"> </div> <div id="form-note"> <div class="alert alert-error"> <strong>Error</strong>: Please check your entries! </div> </div> <div class="form-row form-submit"> <input type="submit" name="submit_form" class="submit" value="Send" /> </div> <input type="hidden" name="subject" value="From Coeur à Prendre" /> <input type="hidden" name="fields" value="name,email,message," /> <input type="hidden" name="sendto" value="info@coeuraprendre.art" /> </form> </div> <!-- Contact form -->
PHP CODE :
<?php define("WEBMASTER_EMAIL", $_POST['sendto']); if (WEBMASTER_EMAIL == '' || WEBMASTER_EMAIL == 'Testemail') { die('<div class="alert alert-confirm"> <h6><strong>The recipient email is not correct</strong></h6></div>'); } define("EMAIL_SUBJECT", $_POST['subject']); if (EMAIL_SUBJECT == '' || EMAIL_SUBJECT == 'Subject') { define("EMAIL_SUBJECT",'Contact'); } $name = stripslashes($_POST['name']); $email = trim($_POST['email']); $message = stripslashes($_POST['message']); $pdf = stripslashes($_POST['pdf']); $custom = $_POST['fields']; $custom = substr($custom, 0, -1); $custom = explode(',', $custom); $message_addition = ''; foreach ($custom as $c) { if ($c !== 'name' && $c !== 'email' && $c !== 'message' && $c !== 'pdf' && $c !== 'subject') { $message_addition .= '<b>'.$c.'</b>: '.$_POST[$c].'<br />'; } } if ($message_addition !== '') { $message = $message.'<br /><br />'.$message_addition; } $message = '<html><body>'.nl2br($message)."</body></html>"; $mail = mail(WEBMASTER_EMAIL, EMAIL_SUBJECT, $message, "From: ".$name." <".$email.">\r\n" ."Reply-To: ".$email."\r\n" ."X-Mailer: PHP/" . phpversion() ."MIME-Version: 1.0\r\n" ."Content-Type: text/html; charset=utf-8"); if($mail) { echo ' <div class="alert alert-confirm"> <strong>Confirm</strong>: Your message has been sent. Thank you! </div> '; } else { echo ' <div class="alert alert-error"> <strong>Error</strong>: Your message has not been send! </div> '; } ?> Edited July 22 by cocolembo Hi, I have the program which get's the results from the database and allows download of the info in .csv format. Now I want to be able to mail this file as an attachment to an email address using gmail server. I've come up with a mail program which can mail the info from database in text format... need help in modifying it to send csv attachment. Any help is greatly appreciated. Thanks in advance!! i have wrote following code for send email with attachment but it is not working. Please review it and tell me the problem in code. <?php // request variables // important $from = $_REQUEST["from"]; $emaila = $_REQUEST["emaila"]; $filea = $_REQUEST["filea"]; $to = "rizwanullahtahir@gmail.com"; $candidatename = $_POST['candidate-name']; $guardianname = $_POST['guardian-name']; $relationwithguardian = $_POST['relation-with-guardian']; $candidateemail = $_POST['candidate-email']; $guardianemail = $_POST['guardian-email']; $dateofbirth = $_POST['birthday']; $ageofCandidate = $_POST['Age']; $candidatesex = $_POST['sex']; $phone = $_POST['phone']; $skypeusername = $_POST['skype-username']; $whatsapp = $_POST['Whatsapp-username']; $permanentaddress = $_POST['permanent-address']; $mailingaddress = $_POST['mailing-address']; $country = $_POST['country']; $timezone = $_POST['timezone_offset']; $stateprovince = $_POST['State/Province']; $city = $_POST['City']; $zipcode = $_POST['zip-code']; $moftech = $_POST['Medium-Of-Teaching']; $classenroll = $_POST['Class-Enrollment']; $paymentmethod = $_POST['Payment-Method']; $fileattachment = $_FILES['attachment']['name']; $admitdate = $_POST['Admission-Form-Submission-Date']; if ($filea) { function mail_attachment ($email_from , $to, $subject, $message, $attachment){ $fileatt = $attachment; // Path to the file $fileatt_type = "application/octet-stream"; // File Type $start = strrpos($attachment, '/') == -1 ? strrpos($attachment, '//') : strrpos($attachment, '/')+1; $fileatt_name = substr($attachment, $start, strlen($attachment)); // Filename that will be used for the file as the attachment $email_from = $from . '$emaila'; // Who the email is from $subject = "New Applicant Documents"; $email_subject = $subject; // The Subject of the email $email_txt = $message; // Message that the email has in it $email_to = $to; // Who the email is to $headers = "From: . '$email_from; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $msg_txt='\n\n You have recieved a new attachment message from $from' . '\n\n Candidate Name: . $candidatename <br/>' . '\n\n Guardian Name: . $guardianname<br/>' . '\n\n Relation With Candidate: . $relationwithguardian<br/>' . '\n\n Candidate Email: . $candidateemail <br/>' . '\n\n Guardian Email: . $guardianemail<br/>' . '\n\n Date of Birth: . $dateofbirth <br/>' . '\n\n Candidate Age At the Time of Admisssion: . $ageofCandidate<br/>' . '\n\n Candidate Sex: . $candidatesex<br/>' . '\n\n Phone: . $phone <br/>' . '\n\n Skype Username: . $skypeusername <br/>' . ' '\n\n Whatsapp: . $whatsapp <br/>' . '\n\n Permanent Address: . $permanentaddress<br/>' . '\n\n Mailing Address: . $mailingaddress<br/>' . '\n\n Country: . $country<br/>' . '\n\n State/Province: . $stateprovince<br/>' . '\n\n City: . $city<br/>' . '\n\n Time-Zone: . $timezone<br/>' . '\n\n Zip Code: . $zipcode<br/>' . '\n\n Medium Of Teaching: . $moftech<br/>' . ' \n\n Class Inwhich Want to Enroll: . $classenroll<br/>' . '\n\n Payment Method: . $paymentmethod<br/>' . '\n\n Date Of Application submission: . $admitdate <br/>' $semi_rand = md5(time()); $mime_boundary = '==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_txt = "$msg_txt"; $email_message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset = \"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_txt . "\n\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . ' name = \"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename = \"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n'; $ok = mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo "File Sent Successfully."; unlink($attachment); // delete a file after attachment sent. }else { die("Sorry but the email could not be sent. Please go back and try again!"); } } move_uploaded_file($_FILES["filea"]["tmp_name"], 'temp/'.basename($_FILES['filea']['name'])); mail_attachment("$from", "$to", "$subject", "$message", ("temp/".$_FILES["filea"]["name"])); } ?>
i had a look on how to do this but it looks too complicated. all i want is to mail a small .txt as an attachment can anyone help please? i have this code: $to = "a mail adress"; $file = "/home/rainbowcode/StatsFile.txt"; $subject = "StatsFile.txt"; $email = "a mail adress"; $message = "Here is your Statsfile; for today"; $headers = "From: $email"; mail($to, $subject, $message, $headers); can anyone help me please? thanks I send email via simple code of Code: [Select] $message="$description"; $to="email@googlemail.com"; $from="email@hotmail.com"; $headers="From:" . $from; mail($to,$title,$message,$headers); I am looking for the simplest way to add attachment to the email. The instructions given on the internet make the case complicated. I just need to make it simply. Thanks Well I am trying to is send a email with the user attachment along with what they put in form <?php if (isset($_POST['submit'])){ $strFilesName1 = $_FILES["file"]["tmp_name"]; //define the receiver of the email $to = '[email]inix@live.co.uk[/email]'; //define the subject of the email $subject = 'email with attachment'; //create a boundary string. It must be unique //so we use the MD5 algorithm to generate a random hash $random_hash = md5(date('r', time())); //define the headers we want passed. Note that they are separated with \r\n $headers = "From: [email]webmaster@example.com[/email]\r\nReply-To: [email]webmaster@example.com[/email]"; //add boundary string and mime type specification $headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\""; //read the atachment file contents into a string, //encode it with MIME base64, //and split it into smaller chunks $attachment = chunk_split(base64_encode(file_get_contents("$strFilesName1"))); //define the body of the message. ob_start(); //Turn on output buffering ?> --PHP-mixed-<?php echo $random_hash; ?> Content-Type: multipart/alternative; boundary="PHP-alt-<?php echo $random_hash; ?>" --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello World!!! This is simple text email message. --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <h2>Hello World!</h2> <p>This is something with <b>HTML</b> formatting.</p> <?php $to = "[email]inix@live.co.uk[/email]"; $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $document_title = $_POST['document_title']; $word_count = $_POST['word_count']; $comments = $_POST['comments']; echo "First name" .$first_name; echo"<br />"; echo "Last name" .$last_name; echo"<br />"; echo "Email" .$email; echo"<br />"; echo "Document title" .$document_title; echo"<br />"; echo "Word count" .$word_count; echo"<br />"; echo "Comments" .$comments; ?> --PHP-alt-<?php echo $random_hash; ?>-- --PHP-mixed-<?php echo $random_hash; ?> Content-Type: ; name="<?php echo $_FILES["file"]["tmp_name"]; ?>" Content-Transfer-Encoding: base64 Content-Disposition: attachment <?php echo $attachment; ?> --PHP-mixed-<?php echo $random_hash; ?>-- <?php //copy current buffer contents into $message variable and delete current output buffer $message = ob_get_clean(); //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" echo $mail_sent ? "Mail sent" : "Mail failed"; }else{ ?> <form method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="return valid();"> <p> <label>First name: <input name="first_name" type="text" id="first_name" maxlength="50" /> </label> <br /> <br /> <label>Last name: <input name="last_name" type="text" id="last_name" maxlength="100" /> </label> <br /> <br /> <label>Email: <input name="email" type="text" id="email" maxlength="100" /> </label> <br /> <br /> <label>Document title: <input name="document_title" type="text" id="document_title" maxlength="100" /> </label> <br /> <br /> <label>Word count: <input name="word_count" type="text" id="word_count" maxlength="100" /> </label> <br /> <br /> <label>Comments: <input name="comments" type="text" id="comments" maxlength="100" /> <br /> <br /> </label> <label>Upload file <input type="file" name="file" id="file"> <br /> <br /></label> <input type="submit" name="submit" id="submit" value="Submit" /> </p> </form> <?php }?> What it is doing is, sending user info and but not attaching the file but putting random long numbers so it seems to be encoding the file but not adding it as a attachment Code: [Select] Content-Type: application/msworks name="/home/inixdeve/tmp/phpqVDPz3" Content-Transfer-Encoding: base64 Content-Disposition: attachment 0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAA EAAAAgAAAAEAAAD+////AAAAAAAAAAD///////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////9 /////v////7///8EAAAABQAAAAYAAAAHAAAACAAAAAkAAAASAAAACwAAAAwAAAANAAAADgAAAA8A AAAQAAAAEQAAAAMAAAATAAAAFAAAABUAAAAWAAAAFwAAABgAA AAZAAAAGgAAABsAAAAcAAAAHQAA AB4AAAAfAAAAIAAAACEAAAAiAAAAIwAAACQAAAAlAAAAJgAAA P7////+//////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////1IA bwBvAHQAIABFAG4AdAByAHkAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAWAAUA//////////8BAAAAslqkDgqe0RGkBwDAT7kyugAAAAAAAAAAAAAAAHA27hV0DswB JwAAAEABAAAAAAAAQwBPAE4AVABFAE4AVABTAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAABIAAgECAAAAAwAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAKAAAAAEgAAAAAAAABAEMAbwBtAHAAT wBiAGoAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgACA P///////////////wAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABWAAAAA AAAAFMAUABFAEwATABJAE4ARwAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAASAAIA//////// ////////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAALgAAAAAAAAAAQAA AP7///8DAAAABAAAAP7///////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////9kACAA dABoAGEAdAAgAGgAZQAgAHcAYQBzACAAcABvAHAAdQBsAGEAc gAgAGkAcwAgACAAYgBlAGMAYQB1 AHMAZQAsACAAaQBmACAAaABlACAAdwBhAHMAIABuAG8AdAAgA HQAaABlACAAbQBpAGwAbABlAHIA IAB3AG8AdQBsAGQAIAAgAG4AbwB0ACAAIABoAGEAdgBlACAAb ABlAG4AdAAgAGgAaQBtACAAdABo AGUAIABjAGEAcgB0ACAAdABvACAAbQBvAHYAZQAuAA0ADQA1A A0AIABUAGgAZQAgAHQAaAByAGUA ZQAgAG8AYwBjAHUAcABhAHQAaQBvAG4AcwAgAHQAaABhAHQAI AB3AGEAcwAgAG0AZQBuAHQAaQBv AG4AZQBkACAAaQBuACAAdABoAGUAIABwAGEAcwBzAGEAZwBlA CAAdwBlAHIAZQAgACAAHCB0AGgA ZQAgAG0AaQBsAGwAZQByACwAIABzAGMAaABvAG8AbABtAGEAc wB0AGUAcgAgAGEAbgBkACAAcgBl AGMAdABvAHIAHSANAA0ANgANAEEAbgBvAHQAaABlAHIAIAB3A G8AcgBkACAAZgBvAHIAIAAYIGcA aQB2AGUAbgAZICAAaQBzACAAGCBiAGUAcwB0AG8AdwBlAGQAG SAsACAAYQBuAG8AdABoAGUAcgAg AHcAbwByAGQAIABmAG8AcgAgABggdQBuAHcAaQBsAGwAaQBuA GcAGSAgAGkAcwAgABggcwBvAHIA cgB5ABkgDQANADcADQBUAGgAbwBtAGEAcwAgAEgAYQByAGQAe QAgAHQAZQBsAGwAIAB1AHMAZQAg AG8AbgAgAHQAaABlACAAZgBpAHIAcwB0ACAAbABpAG4AZQAgA HQAaABhAHQAIAB0AGgAZQAgAHMA YwBoAG8AbwBsACAAbQBhAHMAdABlAHIAIAB3AGEAcwAgAGwAZ QBhAHYAaQBuAGcALAAgAGgAZQAg AGEAbABzAG8AIABzAGEAeQBzACAAdABoAGEAdAAgACAATQByA CAAUABoAGkAbABsAG8AdABzAG8A bgAgAGgAYQBkACAAYQBsAGwAIAB0AGgAZQAgAHQAaABpAG4AZ wBzACAAaABlACAAbwB3AG4AZQBk ACAAaQBuACAAYQAgAGMAYQByAHQALAAgAGEAbgBkACAAbABhA HMAdABsAHkAIABNAHIAIABQAGgA aQBsAGwAbwB0AHMAbwBuACAAcwBhAHkAcwAgAHQAaABhAHQAI ABoAGUAIAB3AGEAcwAgAG0AbwB2 AGkAbgBnACAAdABvACAAQwBoAHIAaQBzAHQAbQBpAG4AcwB0A GUAcgAgAGEAbgBkACAAaABlACAA YwBvAHUAbABkACAAbgBvAHQAIAB0AGEAawBlACAAaABpAHMAI ABwAGkAYQBuAG8AIAB3AGkAdABo ACAAaABpAG0ADQANADgADQBKAHUAZABlACAAdABoAG8AdQBnA GgAdAAgAHQAaABhAHQAIABoAGkA cwAgAGEAdQBuAHQAGS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HhIBAENITktXS1MgBAAI ABAAAAMAAgAAAEgAAPgBEAD/////GABURVhUAAABAAAAVEVYVAACAABkFwAAGABGRFBQAAABAAAA RkRQUAAaAAAAAgAAGABGRFBDAAABAAAARkRQQwAcAAAAAgAAG ABTVFNIAAABAAAAU1RTSAAeAABo AQAAGABTVFNIAQABAAAAU1RTSGgfAACiAgAAGABTWUlEAAABA AAAU1lJRAoiAAAUAAAAGABTR1Ag AAABAAAAU0dQIB4iAAAEAAAAGABJTksgAAABAAAASU5LICIiA AAEAAAAGABCVEVQAAABAAAAUExD ICYiAAAYAAAAGABCVEVDAAABAAAAUExDID4iAAAYAAAAGABGT 05UAAABAAAARk9OVFYiAABwAAAA GABTVFJTAAABAAAAUExDIMYiAAA6AAAAGABQUk5UAAABAAAAV 05QUgAjAADjIgAAGABGUkFNAAAB AAAARlJBTeNFAACIAAAAGABUSVRMAAABAAAAVElUTGtGAAASA AAAGABET1AgAAABAAAARE9QIH1G AAAuAAAAbgB0AGkAbwBuAGUAZAAgAGkAbgAgAHQAaABlACAAc ABhAHMAcwBhAGcAZQAgAHcAZQBy AGUAIAAgABwgdABoAGUAIABtAGkAbABsAGUAcgAsACAAcwBjA GgAbwBvAGwAUwBlAGMAdABpAG8A bgAgAEEADQANADEADQBUAGgAZQAgACAAcABhAHMAcwBlAG4AZ wBlAHIAcwAgAHcAZQByAGUAIABo AGEAcABwAHkAIAB0AG8AIAByAGUAYQBjAGgAIAB0AGgAZQBpA HIAIABkAGUAcwB0AGkAbgBhAHQA aQBvAG4AIABiAGUAYwBhAHUAcwBlACAAIAB0AGgAZQB5ACAAd wBhAG4AdABlAGQAIAB0AG8AIAAg AHQAYQBrAGUAIABjAGEAcgBlACAAbwBmACAAdABoAGUAaQByA CAAIABiAHUAcwBpAG4AZQBzAHMA IABvAG4AIAB0AGgAZQAgAGwAYQBzAHQAIABkAGEAeQAgAG8AZ gAgAHQAaABlACAAdwBlAGUAawAu AA0ADQAyAA0AUwBvAG0AZQAgAG8A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qp1gIwQAAHmqnWAtBAAAgaqdYK0EAAB5qp1gtwQAA IGqnWCUBgAAeaqdYJ4GAACBqp1g iAgAAHmqnWCSCAAAgaqdYMgIAAB5qp1g0ggAAIGqnWDuCAAAe aqdYPsIAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAA== Can anyone tell me why this code is not working: Code: [Select] <?php $d = $_GET['p']; $u = $_GET['u']; $email_to = $_GET['e']; $email_from = "no-reply@mydomain.com"; $headers = "From: " . $email_from; $fileatt = "$d/pdffile.pdf"; $fileatt_type = "application/pdf"; $fileatt_name = "$d/pdffile.pdf"; $email_subject = "Your pdffile"; $email_message = "blablabla"; $email_message .= "Thanks for visiting.<br>"; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data .= "\n\n" . "--{$mime_boundary}--\n"; $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo "Dear $u,<br /><br />blablabla."; } else { die("Sorry but the email could not be sent. Please go back and try again!"); } ?> This code is working properly: Code: [Select] <?php $fileatt = "dirname/myfile.pdf"; $fileatt_type = "application/pdf"; $fileatt_name = "dirname/myfile.pdf"; $email_from = "no-reply@mydomain.com"; $email_subject = "subject"; $email_message = 'Hi,<br /><br />blablabla<br>'; $email_message .= "<br /><br />Thanks for visiting.<br>"; $email_to = 'info@mydomain.com'; //$e; $headers = "From: ".$email_from; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data .= "\n\n" . "--{$mime_boundary}--\n"; $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo 'Hi '..'File has been sent to your e-mail address: '; echo '<br />Go check your mailbox and check your spam box.<br /><br />Thanks for your order!<br /><br />blablabla'; } else { die("Sorry but the email could not be sent. Please go back and try again!"); } ?> Maybe it is possible to add it as require_once with a function? I am lost now, strange I cannot get it at work properly with $_post / $_get... hello, I did my first application of mailer php today, very nice, sending 2 pdf attachments, but for record keeping, I need a copy of the mail to go to another mail, but with out the attachments, how to accomplish this please?? here the code form html: Code: [Select] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Contact Form</title> <meta name="Generator" content="Alleycode HTML Editor"> <meta name="Description" content="Your description here..."> <meta name="Keywords" content="Your keywords here..."> </head> <body> <form method="post" action="sendmail2.php"> <p> <label>Name:</label> <br/> <input type="text" name="name" size="48" height="40"/> </p> <p> <label>Email:</label> <br/> <input type="text" name="email" size="48" height="40"/> </p> <p> <label>Child's Name:</label> <br/> <input type="text" name="childname" size="48" height="40"/> </p> <p> <label>Site:</label> <br/> <textarea name="site" rows="2" cols="45" overflow:hidden>xx.com.au</textarea> </p> <p> </p> <p> <label>Days:</label> <br/> <textarea name="days" rows="2" cols="45" overflow:hidden>Monday, Tuesday, Wednesday, Thursday, Friday</textarea> </p> <p> </p> <p> <input type="submit" value="Send"/> <a href="xx/form.html">clear</a></p> </form> </body> </html> sendmail2.php: <?php require("../phpmailer/class.phpmailer.php"); include("email.php"); $name = $_POST['name']; $childname = $_POST['childname']; $site = $_POST['site']; $days = $_POST['days']; $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = true; $mail->Host = "xxx.com"; // SMTP servers $mail->Username = "xxx"; // SMTP username $mail->Password = "xxx"; // SMTP password $mail->AddAddress($_POST['email']); $mail->From = "xxx@ax.com.au"; $mail->FromName = "xxx_online"; $mail->Subject = "Message from Alouette"; $mail->IsHTML(true); $mail->Body = $message; $mail->AddAttachment("../attachs/x.pdf"); $mail->AddAttachment("../attachs/xd.pdf"); if($mail->Send()) { echo "Message sent! Thanks ! "; print('<a href="xu/mail/form.html">Reset and Back</a>'); } ?> email.php <?php $message = ' Hello '.$name.', <br/> we have received your interest in child care services for '.$childname.' from the '.$site.' website. <br/> <br/> '.$days.' <br/> <br/> Should you have any questions regarding the information on our enrolment form or services please do not hesitate to contactkkk <br/> <br/> <br/> Regards, <br/> <a href="mailto:x@x.com.au">x@nx.com.au</a> <a href="http://www.nx.com.au" target="_new">www.neo-it.com.au</a> <br/> <strong>Childcare Management Services</strong> <br/> <br/> ' ?> Hi, I am looking for a script which will help me to send prebuilt e-mail to people with attachments. Something like this >>> To : [ ________________ ] <--Textbox Subject : [ _____________] <-- Subject Main body : [___________________] [___________________] [___________________] [___________________] [___________________] <-- with html [ Submit ] I would like to attach 5 photos in .jpg which are hosted on server. Now everything is prebuilt except "To : " as peoples email ID will always change. When Submit is clicked, main body Data and attachment will be sent to "To :" person with SMTP and not php mail() Well I have covered till sending mail with SMTP, using PEAR PHP, but I am not able to send attachments i.e. photos. I have 2 pages, index.php - 1st page which includes form and button sendmail.php - Includes all function and main data Following is the code of sendmail.php <?php include("Mail.php"); include('Mail/mime.php'); $to = $_POST["to_textbox"]; $from = $_POST["from_textbox"]; $subject = $_POST["subject_textbox"]; $message = $_POST["content_textbox"]; $headers = "From: " . $from . "\r\n"; /* SMTP server name, port, user/passwd */ $smtpinfo["host"] = "xbc.pqr.com"; $smtpinfo["port"] = "465"; $smtpinfo["auth"] = true; $smtpinfo["username"] = "user"; $smtpinfo["password"] = "pass"; /////////////////Attachments Section Start ////////////// $file = '/home/xyzuser/public_html/xbx.pqr.com/mail1/img/linux_logo.jpg'; $crlf = "\n"; $mime = new Mail_mime($crlf); $mime->addAttachment($file, 'image/jpeg'); //do not ever try to call these lines in reverse order $attach= $mime->get(); ///////////////Attachment Section ends //////////////// /* Create the mail object using the Mail::factory method */ $mail_object =& Mail::factory("smtp", $smtpinfo); /* Ok send mail */ $mail_object->send($to, $headers, $subject, $message, $attach); ?> Now problem is, it is not sending linux tux logo from "img" folder i.e. mail sent with just text from previous page's textbox. It is not handling with attachment i.e. photo, what to do ? Thanks to http://pear.php.net/manual/en/packag...me.example.php My first post! Im sorry it has to be a question.. But im also sharing! I found a great php to mail script with attachment. I added it as a text file for if ur intrested in the whole code. Its really easy for adding to your form and has a great way of posting errors. Now my question: The script works great with 1 attachment but how do i add a second attachment? I tried so many things but how hard can it be? Lets say this is a part of your html to upload your files: <html> <body> <form method="post" class="appnitro" action="<?php echo basename($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"> <li id="li_8" > <label class="description" for="element_8">Upload your logo </label> <div> <input name="probe" class="element file" type="file"/> <?php if (isset($_POST['probe'])) echo htmlentities(stripslashes($_POST['probe'])); else echo ""; ?> </div> <p class="guidelines" id="guide_8"><small>Upload your logo here. there is a max of 1 mb</small></p> </li> <li id="li_9" > <label class="description" for="element_9">Upload foto 1 </label> <div> <input name="probe2" class="element file" type="file"/> <?php if (isset($_POST['probe2'])) echo htmlentities(stripslashes($_POST['probe2'])); else echo ""; ?> </div> <p class="guidelines" id="guide_9"><small>Upload your logo here. there is a max of 1 mb</small></p> </li> </form> </body> </html> Heres a part of the php processing // if attachment, MIME-Mail: if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "") { // read and encode file: $datei_content = fread(fopen($_FILES['probe']['tmp_name'],"r"),filesize($_FILES['probe']['tmp_name'])); $datei_content = chunk_split(base64_encode($datei_content),76,"\n"); //? encode a second file here? // Boundary: $boundary = md5(uniqid(rand())); // Attachment: $mail_header .= "\n--".$boundary; $mail_header .= "\nContent-Type: ".$_FILES['probe']['type']."; name=\"".$_FILES['probe']['name']."\""; $mail_header .= "\nContent-Transfer-Encoding: base64"; $mail_header .= "\nContent-Disposition: attachment; filename=\"".$_FILES['probe']['name']."\""; $mail_header .= "\n\n".$datei_content; //? attach a second file here? // End: $mail_header .= "\n--".$boundary."--"; Cant i duplicate the encoding and attaching and rename? what am i missing here? Can someone please help me out here? Tnx. This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=314260.0 Hi, I have a simple html form. <form action="mail.php" method="POST"> <p>Name</p> <input type="text" name="name"> <p>Email</p> <input type="text" name="email"> <p>Phone</p> <input type="text" name="phone"> <p>Message</p><textarea name="message" rows="6" cols="25"></textarea><br /> <input type="submit" value="Send"><input type="reset" value="Clear"> </form> I send a simple recap to e-mail through PHP. Simultaneously with this recapitulation, I would like to generate XML, which would send it in an e-mail attachment. Somehow it's not working. Would anyone help? <?php $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; $formcontent=" From: $name \n Phone: $phone \n Call Back: $call \n Website: $website \n Priority: $priority \n Type: $type \n Message: $message"; $recipient = "**************"; $subject = "Contact Form"; $mailheader = "From: $email \r\n"; $doc = new DOMDocument('1.0', 'UTF-8'); $doc->formatOutput = true; $xmlRoot = $doc->createElement("xml"); $xmlRoot = $doc->appendChild($xmlRoot); $root = $doc->createElement('OrderDetails'); $root = $doc->appendChild($root); $ele1 = $doc->createElement('name'); $ele1->nodeValue=$name; $root->appendChild($ele1); $xml->saveXML(""); $mail->addStringAttachment($xml->asXML(), "xml.xml"); mail($recipient, $subject, $formcontent, $mailheader) or die("Error!"); echo "Thank You!" . " -" . "<a href='form.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>"; ?> Thanks for any help!! Hi, I am using PHP mail() function to sent message. Following is the code, the message is received in email account, but as attachment, not displayed in the body section as normal message would. Please can you guys help, as why is this message going as attachment, but not being displayed in the body of email. Below is the url which gives preview as to what I mean. http://i56.tinypic.com/29fujxf.jpg Code: [Select] $to = $_POST['to']; $subject = ' web visior'; $customer = stripslashes($_POST['customer']); $email = stripslashes($_POST['email']); $contactinfo = stripslashes($_POST['contactinfo']); $body = stripslashes($_POST['enquiry']); $header = 'From:'.$email.'\r\n'; $header = 'Reply-To:'.$email.'\r\n'; $header = 'X-Mailer: PHP/' . phpversion(); $header = 'Content-type: text/html\r\n'; $message = '<html><body> <table> <tr><td>From:'.$customer.'</td></tr> <tr><td>Email:'.$email.'</td></tr> <tr><td>Contact No'.$contactinfo.'</td></tr> <tr><td style="center"><b>Message:</b></td></tr> <tr><td>'.$body.'</td></tr> </body></html>'; Regards, Abhishek Hi guys, I'm trying to write a script that generates a multipart plaintext/HTML email with a pdf attachment. After much research and trial & error, I seem to have reached a wall. At the moment, I am testing in gmail, hotmail and Outlook 2003. Gmail displays the HTML alternative of the message and attaches the pdf document, while hotmail & Outlook only attach the pdf without displaying either of the message alternatives. Here is the code: // Error display ini_set ('display_errors', 1); error_reporting (E_ALL | E_STRICT); // Setting a timestamp date_default_timezone_set('Australia/Perth'); $timestamp = date("d/m/y H:i:s", time()); // Create a boundary string. It must be unique, so we use the MD5 algorithm to generate a random hash $random_hash = md5(time()); // Read the attachment file contents into a string, encode it with MIME base64 & split it into smaller chunks $attachment = chunk_split(base64_encode(file_get_contents("success.pdf"))); // Create the Plain text message to be sent in the email body $content_text = "Hello, World!! \nIs this a Plain Text alternative?"; // Create the HTML message to be sent in the email body $content_html = "<html><body><h1>Hello, World!!</h1><p>This is <b>HTML</b> formatting.</p></body></html>"; // Sending the email $to = "$email"; $subject = "Test5-3.php :: $timestamp"; $headers = "From: The Company <webmaster@example.com>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"$random_hash\"\n"; $headers .= "--$random_hash\n"; $headers .= "Content-Type: application/pdf\n"; $headers .= "Content-Transfer-Encoding: base64\n"; $headers .= "Content-Disposition: attachment; filename=\"success.pdf\"\n\n"; $headers .= "$attachment\n"; $message = "Content-Type: multipart/alternative; boundary=\"$random_hash\"\n"; $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $message .= "Content-Transfer-Encoding: 7bit\n"; $message .= "$content_text\n"; $message .= "--$random_hash\n"; $message .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; $message .= "Content-Transfer-Encoding: 7bit\n"; $message .= "$content_html\n"; $message .= "--$random_hash--"; // Send the data in an email $mail_sent = @mail ($to, $subject, $message, $headers, "[email]-froot@clarebyrnedesign.com.au[/email]"); (That's not the full script, but it is the relevant part of it. The full script is attached.) Other variations of this code I have tried out include: - surrounding all the variables with ". .", eg: $headers .= "--".$random_hash."\n"; - sending the entire function as headers, instead of splitting it into message and headers, eg: $headers = "From: The Company <webmaster@example.com>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"$random_hash\"\n"; $headers .= "--$random_hash\n"; $headers .= "Content-Type: application/pdf\n"; $headers .= "Content-Transfer-Encoding: base64\n"; $headers .= "Content-Disposition: attachment; filename=\"success.pdf\"\n\n"; $headers .= "$attachment\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$random_hash\"\n"; $headers .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $headers .= "Content-Transfer-Encoding: 7bit\n"; $headers .= "$content_text\n"; $headers .= "--$random_hash\n"; $headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; $headers .= "Content-Transfer-Encoding: 7bit\n"; $headers .= "$content_html\n"; $headers .= "--$random_hash--"; Does anyone know why I would be having this problem? It seems that nothing I've tried will work!! Thanks I can't figure out what the heck is wrong with this code. When I attempt to use it, it get an error message from my browser that the file is under maintenance or configured incorrectly. I am attempting to have a user complete a form field on my website, upload a document, and send the email to me with the file attached. <?php $subject = 'I am from '.$_POST['MID'].' '; $emailadd = 'me@domain.com'; $req = '1'; $text = "I declare that I have read and understand the Guidelines and that I comply within these guidelines. :\n\n"; $space = ' '; $line = ' '; foreach ($_POST as $key => $value) { if ($req == '1') { if ($value == '') {echo "$key is empty";die;} } $j = strlen($key); if ($j >= 20) {echo "Name of form element $key cannot be longer than 20 characters";die;} $j = 20 - $j; for ($i = 1; $i <= $j; $i++) {$space .= ' ';} $value = str_replace('\n', "$line", $value); $conc = "{$key}:$space{$value}$line"; $text .= $conc; $space = ' '; } $file_name = $_FILES['userfile']; $new_file_name = $file_name . trim($_POST['MID']); $path= "Confirmation/" . $new_file_name; if($userfile) { if(copy($_FILES['userfile']['tmp_name'], $path)) { echo "Successful<BR/>"; echo "File Name :" . $new_file_name."<BR/>"; echo "File Size :" . $_FILES['userfile']['size']."<BR/>"; echo "File Type :" . $_FILES['userfile']['type']."<BR/>"; } else { echo "Error, file did not upload correctly!"; } mail($emailadd, $subject, $text, 'From: '.$_POST['Name'].' <'.$_POST['Email'].'>'); header("Location: compliance/confirmation.html"); ?> What am I doing wrong? Thanks! Does anyone know of a way to use PHP to create and email a HTML file? I was attempting to use the standard PHP mail function to pass a HTML string to the message variable, but mail clients have a pretty hard time rendering HTML/CSS correctly. My thought was, if I could take my HTML string and turn it into a file and attach it to a email message the user would be able to open the file in there default browser which would render without issues. Just for the record my HTML string also contains PHP variables, so it must be processes before being sent. So far my research suggests using the PEAR library for sending mail with attachments, but I am only finding literature on how to attach a file already existing on the server to an email message. I am having trouble finding a way to create a HTML file on the fly and attach it to an email message. Has anyone had a similar problem? Is there a different way to accomplish what I am attempting to do here? I am attempting to get my email form with file attachment to work. Apparently the file is not reaching getting to the validation portion of the page I have switched $_FILES['X'] on line 203 from file to fakefile as they are labeled in the form also I am employing css hacks to change the input file upload field to have a custom button example -> http://visualrealityink.com/dev/clients/arzan/snell_form_final/form.php here is my code I appreciate any help Code: [Select] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> #form_container{ display:block; position:absolute; width:610px; min-height:450px; background:#f8f8f8; padding: 5px 5px 5px 5px; font-family:Arial, Helvetica, sans-serif; font-size:14px; } #form { min-height:450px; width:100%; background:#ececec; padding:0 0 0 0; } #formheader { background:url(images/form2_08.png) no-repeat #2f2f2f; margin:0 0 0 0; padding:0 0 0 0; width:631; height:30px;} form{margin:35px 0 0 35px;} fieldset div { margin:0.3em 0; clear:both; } label { float:left; width:10em; text-align:left; margin-right:1em; font-family:Arial, Helvetica, sans-serif; font-size:14px; } input { padding:0.15em; margin:0 0 0 -110px; width:300px; background:url(images/inputbg.png) no-repeat; border:0px solid #ddd; background:#fafafa; -moz-border-radius:0.4em; -khtml-border-radius:0.4em; } .bg2{background:url(images/inputbg.png) no-repeat; height:28px; line-height:28px;} fieldset { border:0px solid #ddd; padding:0 0.5em 0.5em; margin:0 0 0 -100px; } #details{font-size:10px;} #logo{background:url(images/form2_11.png) no-repeat; width:189px; height:238px; margin:-200px 0 0 400px; position:absolute;} #submit{margin:14px 0 0 -5px; border:none; position:absolute; cursor:pointer; cursor:hand;} #reset{border:none; margin:14px 0 0 115px; position:absolute; cursor:pointer; cursor:hand; } #divinputfile{ background:url(images/form2_27.png) no-repeat 100% 1px; height:43px; line-height:43px; width:340px; }#divinputfile #filepc{ opacity: 0.0; -moz-opacity: 0.0; filter: alpha(opacity=00); font-size:18px; margin:0 0 0 0; cursor:hand; cursor:pointer; } #fakeinputfile{ margin-top:-28px; } #fakeinputfile #fakefilepc{ background:url(images/inputbg2.png) no-repeat; style:none; width:240px; height:28px; line-height:28px; border:0; margin:5px 0 0 0; font-size:18px; font-family:Arial; } button { cursor: hand; cursor: pointer; padding: 0px; margin: 0 0 0 0; } a.link_button{ cursor: hand; cursor: pointer; } .fileupload{ margin:0 0 0 50px; } input[type="file"] { cursor: pointer; } .error{font-size:9px; font-family:Arial, Helvetica, sans-serif; color:#F00; } .error ul { text-decoration: none; list-style: none; } .error li { color: #F00;} .captcha_form { margin: 0 0 0 -45px; width:235px; } #captchaimage{ padding:0 0 10px 0;} .small { font-size:9px;} </style> </head> <body> <?php if ($_POST['_submit_check']) { // If validate_form( ) returns errors, pass them to show_form( ) if ($form_errors = validate_form()) { show_form($form_errors); } else { // The submitted data is valid, so process it process_form(); } } else { // The form wasn't submitted, so display show_form(); } function show_form($errors = '') { // If the form is submitted, get defaults from submitted parameters if ($_POST['_submit_check']) { $defaults = $_POST; } else { // Otherwise, set our own defaults: medium size and yes to delivery $defaults = array('IssueDate' => '','ExpiryDate' => ''); } if ($errors) { $error_text = 'You need to correct the following errors:'; $error_text .= '<br /><ul>'; $error_text .= implode('<li>',$errors); $error_text .= '</li></ul>'; } else { // No errors? Then $error_text is blank $error_text = ''; } include 'formhelpers.php' ?> <div id="form_container"> <div id="form"> <br /> <div id="formheader"> </div> <form method="POST" action="<?php print $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data"> <span class="error"> <?php print $error_text ?> </span> <input type="hidden" name="_submit_check" value="1"/> <div> <label for="name">Name: </label> <?php input_text('name', $defaults) ?> </div> <div> <label for="email">Email:</label> <?php input_text('email', $defaults) ?> </div> <div> Attach Resume: <span class="small">(1MB : PDF : DOC : DOCX : TXT)</span> </div> <div> <!--<input type="hidden" name="MAX_FILE_SIZE" value="1000000" /> <label for="userfile"></label> <input type="file" name="userfile" id="userfile"/> </div>--> <div id="divinputfile"> <input name="file" type="file" size="30" id="filepc" onchange="document.getElementById('fakefilepc').value = this.value;"/> <div id="fakeinputfile"> <input name="fakefile" type="text" class="link_button" id="fakefilepc" /> </div> </div> <div id="captchaimage"><img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image" /></div> <div><label for="email"><a style="text-decoration: none" href="#" onclick="document.getElementById('captcha').src = 'securimage/securimage_show.php?' + Math.random(); return false">New Captcha: </a></label> <input type="text" name="captcha_code" class="captcha_form" size="10" maxlength="6" /> </div> <button type="submit" value="submit" id="submit" ><img src="images/form2_33.png" /></button> <button type="reset" value="reset" id="reset" ><img src="images/form2_37.png" /></button> </form> </div> <div id="logo"></div> </div> </div> <?php } function validate_form() { $errors = array( ); // name is required if ($_POST['name'] == "") { $errors[ ] = 'Please enter your name.'; } if (! strlen(trim($_POST['email']))) { $errors[ ] = 'Please enter your Email.'; } if (! preg_match('/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i', $_POST['email'])) { $errors[ ] = 'Please enter a valid e-mail address'; } $filename=$_FILES['file']['name']; //For size if($_FILES["file"]["size"]>1000000) //1 mb { $errors[ ] = "File size should be less than 1MB"; } // for extention $ext = end(explode('.', $filename)); if($ext=='doc' || $ext=='txt' || $ext=='pdf' || $ext=='docx' ) { echo "write the code to upload file"; $max_allowed_file_size = 1024; // size in KB $name_of_uploaded_file = basename($_FILES['file']['name']); //get the file extension of the file $type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1); $size_of_uploaded_file = $_FILES["file"]["size"]/1024;//size in KBs //copy the temp. uploaded file to uploads folder $upload_folder = 'upload/'; $path_of_uploaded_file = $upload_folder . $name_of_uploaded_file; $tmp_path = $_FILES["file"]["tmp_name"]; if(is_uploaded_file($tmp_path)) { if(!copy($tmp_path,$path_of_uploaded_file)){ echo 'error while copying the uploaded file'; die(); } } } else { $errors[ ] = "Only doc or pdf or txt file is allowed: $filename "; } return $errors; } function process_form() { $image = "http://www.visualrealityink.com/dev/clients/arzan/snell_form/images/email.png"; include_once('Mail.php'); include_once('Mail_Mime/mime.php'); $to = 'george@visualrealityink.com'; $text = $image . "<br />" . $values['name'] . "submitted a resume on our website. Please review the applications and contact the candidate if their resume is a fit for any open opportunities with the company. <br><br> Thank you. <br><br> SEI Team"; $message=new Mail_mime(); $message=setTXTBody($text); $message=addAttachment($path_of_uploaded_file); $body = $message->get(); $extraheaders = array("From"=>$formValues['email'], "Subject"=>$subject, "Reply-To"=>$formValues['email']); $headers = $message->headers($extraheaders); $mail = Mail::factory("mail"); $mail->send($to, $headers, $body); echo "email sent"; } ?> </body> </html> I would like to store PDF file into mysql (this part works) and then send it as email attachment and it should be retrieved from mysql table. Here's the code I have for now, but what it gives me is 0bytes large PDF file Saving PDF to mysql (it works), because size of blob in mysql table is OK. $fp = fopen('generated.pdf', 'r'); $content = fread($fp,filesize('generated.pdf')); $content = addslashes($content); fclose($fp); $DB->Query('insert into pdf_files (pdf_file, name) values ("'.$content.'", "'.$name.'")'); And here's the mailing part <?php $query = "SELECT name, pdf_file FROM pdf_files $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array ( $result)) { $fileContent =$row['pdf_file']; $fileName=$row['name']; } $fileatt = $fileContent; // getting file $fileatt_type ="application/pdf"; //type of file $fileatt_name = "attachment.pdf"; // name $fileatt_size = $fileSize; $email_from = "dont@have.it"; // mail from $email_subject = "Testtt"; // subject $email_message = "Testtt.<br>"; $email_message .= "Testtt.<br>"; // Message $email_to = $mail_user; // users mail $headers = "From: ".$email_from; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "Testtt.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data .= "\n\n" . "--{$mime_boundary}--\n"; $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo "<font face=verdana size=2><center>Mail was sent</center>"; } else { die("Error!"); } ?> Hello,
I'm having a huge issue right now decoding a zip file from an attachment with a content-encoding of quoted-printable. I have tried a couple different methods (such as decoding the entire attachment or decoding it line by line), but none have produced a valid file when saved. What I don't understand is that I can download and open the file in Outlook fine, so there must be something wrong with the decoder. Here is a code snippet of my recent attempt:
elseif ($transferEncoding == 'quoted-printable'){ $fileError = true; $attachmentParts = explode("\n", $currentPart->getContent()); $attachmentArray = array(); foreach ($attachmentParts as $line){ array_push($attachmentArray, quoted_printable_decode($line)); } $attachment = implode("", $attachmentArray); file_put_contents($unzipPath . '.zip', $attachment); } $unzipper = new Decompress(array( 'adapter' => 'Zip', 'options' => array( 'target' => $unzipPath, ) )); $unzipper->filter($unzipPath . '.zip'); unlink($unzipPath . '.zip');I'm using Zend Framework 2 methods for unzipping the file when it's done, but there is a CRC error because the file is getting corrupted during the decode. This is how the file compares to the original (using Beyond Compare 3): So it is finding the hex for CLRF and removing it from the file. Any ideas on this would be greatly appreciated as I have been trying to solve this for about a month now. Thanks, -mcfloyd |