TheScripter Posted September 26, 2012 Share Posted September 26, 2012 Alright so I have use the PHP mail() function pretty extensively, however for my new site I will need to collect a filled fillable pdf file downloaded from my site, pull it from the files array, then send it to my e-mail so I can look at it later. I can do all of it except attach the .pdf file. How would I go about this? Please don't give me complete code because that is too easy. I wan't to figure it out myself but the tutorials simply don't explain what is happening. Quote Link to comment https://forums.phpfreaks.com/topic/268801-how-to-send-an-e-mail-with-an-attachment/ Share on other sites More sharing options...
Christian F. Posted September 26, 2012 Share Posted September 26, 2012 (edited) I recommend looking at the PHPMailer class, as it'll help you get past all of the tedium with anti-spam counter measures. To read the file, you'll need file_get_contents () and base64_encode (). Edited September 26, 2012 by Christian F. Quote Link to comment https://forums.phpfreaks.com/topic/268801-how-to-send-an-e-mail-with-an-attachment/#findComment-1381000 Share on other sites More sharing options...
TheScripter Posted September 28, 2012 Author Share Posted September 28, 2012 Well I want to do it with just normal php. Anyone have a snippet they can explain to me? Quote Link to comment https://forums.phpfreaks.com/topic/268801-how-to-send-an-e-mail-with-an-attachment/#findComment-1381657 Share on other sites More sharing options...
jazzman1 Posted September 28, 2012 Share Posted September 28, 2012 Well I want to do it with just normal php. Anyone have a snippet they can explain to me? What do you mean by "just normal php" ? I'm using swiftmailer. You have to spend maximum 30 min, to configure the script for you.... Quote Link to comment https://forums.phpfreaks.com/topic/268801-how-to-send-an-e-mail-with-an-attachment/#findComment-1381660 Share on other sites More sharing options...
Maq Posted September 28, 2012 Share Posted September 28, 2012 Then you'll have to install and configure something like sendmail or postfix and use mail(). There are examples in the manual of how to let users create attachments. Quote Link to comment https://forums.phpfreaks.com/topic/268801-how-to-send-an-e-mail-with-an-attachment/#findComment-1381664 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.