August 12, 200917 yr I've got a few PDFs that have a field for inputting an email address and submitting. What I want the submit button to do is submit a copy of the page to the users email address without using an email client, and from what I've found I need to get the submit to send to a php file that automates this. Can someone help with the code for the PHP file? I've found this code to upload a file but can this be used to send an existing file on a server to an email address submitted? or can someone recommend something else?? Thanks <form method="post" enctype="multipart/form-data"><input type="file" name="yourForm"><input type="submit" value="Upload and send"></form> ---other script (sorry its php...thats all i ever do scripting in because asp sucks)--- <?php ... $mail = new PHPMailer(); //google this if you want ...general email stuff... $mail->addattachment($_FILES['yourForm']['tmp_name'], $_FILES['yourForm']['name']); $mail->send(); ... ?>
August 14, 200917 yr the best way to send a pdf is to send a link to the pdf which is uploaded on to the server, sending attachments is a headache, they get blocked in some clients marked as spam in others dont get there sometimes.
August 23, 200917 yr Author I worked this out by using a Flash file that sent an email to a server and attached the required page(s).
Create an account or sign in to comment