Jump to content

Php Formail Script


karmacriminal

Recommended Posts

I am using Surefires Form to Mail PHP Script found here: Script

 

I FINALLY got this to work but am new to PHP and have a couple question...

 

1 - What variables would I use in my form to give my email a subject Line?

2 - How do I use the file upload part of the script? What variables would I use?

 

Thanks in advance

Link to comment
Share on other sites

It has many functions so you won't need any PHP knowledge.

heh - you don't need to know php because it's a CGI script. :P But I'll look at it to see if it can do the things I need. :D

 

 

I actually have a similar question about surefire's script.

 

It works great for the basics, but I'm wondering if it can do 2 additional things:

 

1) Attach a file to the email (not upload it to my webserver)

2) Add an input field to the subject line.

 

For instance - the user enters in his/her name in the NAME field. Then I get the email with the subject of: Feedback form from NAME

 

Is this possible?

Link to comment
Share on other sites

For instance - the user enters in his/her name in the NAME field. Then I get the email with the subject of: Feedback form from NAME
Yes. You just have to go into the code of the script and add the variable into the spot where you see the mail() function. That's where the rubber meets the road, so to speak.

 

1) Attach a file to the email (not upload it to my webserver)

 

I'll give this a try since others have asked the same thing. It is written to make this happen, but I haven't put it into use.

 

Lots of folks think I wrote the script... but I didn't... I've made some improvements to the original one. I'll test it out tonight.

Link to comment
Share on other sites

I just gave it a shot, and at first glance, it doesn't appear to work. This is a perfect time to remind folks that I didn't make the script.

 

Looking closer at the script, it appears that if it did work, that it would essentially upload the file to your site, and email you the location of the file one your site.

 

I don't think this would be a very good way to do it... and judging by the error message, I wouldn't be surprised if permissions had to be changed to allow this.

 

Everything I've read on PHP indicates that the regular mail() function is NOT the way to send attachments.

 

The way I would do it would be to use an object oriented script that uses smtp to send email. This allows attachments.

 

I'm considering looking into this.

 

I think the folks at TCH need a super charged php formmail script that can be developed and added to.

Link to comment
Share on other sites

This will be fun. I love giving back to TCH (and others).

 

Plus, I won't be the only one putting it together. With so many great minds, I think this will be quite an excellent work in progress.

 

I'll start a new discussion in the scripting forum and let others contribute ideas.

Link to comment
Share on other sites

Karmacriminal, your wishes have come true. The script is done. Please see my post "Ultimate Form Mail Script".

 

The code isn't up and online yet... I'm still debugging... but it works awesome!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...