The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Sending Email with Attachment - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Sending Email with Attachment (/showthread.php?tid=24886)



Sending Email with Attachment - CHirst87 - May 18th, 2017

Hey everyone,

I created an HTML form that has the option of attaching a file.  In the process.php for formtools, I've created a personalized email to anyone who fills out the form.  The email is sent to whoever filled out the form (they're forced to provide email address) and it sends them their answers for the form.  Everything works fine with the plain text but I can't figure out what php script would be needed in order to email the user whatever file they attached while submitting the form.  Currently, the files upload properly within formtools on my server, I just can't figure out how to get the file to appear as an attachment with the user's email after submitting.

Any chance for help on this?


RE: Sending Email with Attachment - bill09 - Jun 1st, 2017

If you added a script to the process.php file, what are you using to send the email? phpmail?

If you have to send as an attachment and not as a link to the uploaded file then PHPMailer would be easier.
https://stackoverflow.com/questions/12301358/send-attachments-with-php-mail

To send using FT's bulit-in email function you can send the submitter an email confirmation with a link to the file.

Under Edit Email Template, Content use something like this:
Uploaded Document: <a href=http://www.yoursite/formtools/upload/{$FILENAME_document1}>{$FILENAME_document1}</a>

'document1' would be what you named the field for the upload.

Or use: https://docs.formtools.org/modules/swift_mailer/