cherylp Posted December 11, 2008 Share Posted December 11, 2008 using php I am looking to send an automated email when a client signs up to my web page. The catch is that I want to attach two PDF's for them to fill out. I am using the following code to just send the email.... include('../mimemail/class.Email.php'); //** establish to,from, and any other recipiants. $Sender = $email; $Recipiant = $client_email2; $Cc = ""; $Bcc = ""; //** create the text and HTML versions of the body content here. ob_start(); //start output buffering include ("emailbody.php"); //all output goes to buffer $buf = ob_get_contents(); //assign buffer to a variable ob_end_clean(); //clear buffer and turn off output buffering $textVersion = $comments; $htmlVersion = $buf; unset($msg); //** !!!! SEND A MULTIPART/ALTERNATIVE EMAIL !!!! //** create the new message using the to, from, and email subject. $msg = new Email($client_email2, $email, "Birddog Contact Form"); $msg->Cc = $Cc; $msg->Bcc = $Bcc; //** set the message to be a multiprat/alternative email. This allows for //** multiple versions of same content. //** NOTE: you cannot send attachments when a message is set to be //** multipart/alternative. there is also no way to switch //** back to normal multipart/mixed after this call. $msg->SetMultipartAlternative($textVersion, $htmlVersion); //** send the email message. $SendSuccess = $msg->Send(); //** !!!! SEND A PLAIN TEXT EMAIL !!!! /* create the new message using the to, from, and email subject. $msg = new Email($Recipiant, $Sender, "A Test Plain Text Email!"); $msg->Cc = $Cc; $msg->Bcc = $Bcc; //** set the message to be text only and set the email content. $msg->TextOnly = true; $msg->Content = $textVersion; //** send the email message. $SendSuccess = $msg->Send(); echo "Plain text email was ", ($SendSuccess ? "sent" : "not sent"), "<br>"; unset($msg);*/ Does anyone know of a quick or easy adjustment to attach files? I'll appreciate anyone's help on this. Quote Link to comment Share on other sites More sharing options...
bluesoul Posted December 11, 2008 Share Posted December 11, 2008 Used this to send CSVs as attachments, provided you've fopen()ed the files and stored them as attachments this should work. --PHP-mixed-<?php echo $random_hash; ?> Content-Type: application/pdf ; name="file.pdf" Content-Transfer-Encoding: base64 Content-Disposition: attachment <?php echo $attachment; ?> --PHP-mixed-<?php echo $random_hash; ?>-- Quote Link to comment Share on other sites More sharing options...
cherylp Posted December 11, 2008 Author Share Posted December 11, 2008 I'm not sure what you mean by storing them as attachments. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.