Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert input from a drop down menu into an email

Status
Not open for further replies.

Gilgalad

IS-IT--Management
Mar 5, 2003
4
US
I manage the IT for a small insurance firm and am pretty new to php so bear with me. I would like to create a drop down menu for users to input info (no problem so far) and, upon submission of it, transfer it into either a text file which can automatically and immeadiately be attached to their email program, or input it directly into their default email program. The goal is for the user to input the data, click on submit, watch the default mail program open and click send. Is this possible with PHP (or CGI)? If I could get some guidence, pointers on where to start, or even appropriate resources to confer I would greatly appreciate it.

Cheers, Robert
 
It would be alot easier to have them fill out the form, add in their email address, and have the web page send the email marking it as sent from them.

You're not going to get the ability through PHP (or CGI) to open a program on the customers computer, nor would you really want to go through the hassle of opening one of a myriad (if they even bothered to tell their OS their default mail program) of programs and send an email through it.

-Rob
 
Actually, I just realized, what you requested would be incredibly easy to do.... but it would require that the user has already setup their default mail program. And it would require them actually clicking the send button (you could fill everything in for them though.

However, realize, 90% of users I've ever seen has outlook express setup as their default mail client regardless of what they actually use. So this may not work at all for them.

-Rob
 
Sorry, I didn't mean to say it was easy and not post how, I clicked send too fast.

Look into href tag with mailto

<a href=&quot;mailto:you@you.com?subject=Submission&quot;>Send it</a>

And I'm fairly certain there's a body in there too... then you just need to output that tag and use javascript to click it... look there's another assumption, they're browser supports javascript... more and more I'd say let the server do it
 
Rob,

Thx for the post, I'm reading the host of pages on mailto at the moment. What I'm thinking is this:

Say we have 5 drop down menus. Is it possible to assign each to a value, then, upon submission, either print those values into an email file and have it marked as sent from them as you suggested, or to print them into a text file and automatically attach the new file via the mailto command? The idea is to have the client do as little work as possible, other than click on 'send.' Thx again,

Robert
 
Ah, see that's what I figured... and the answer is very much yes.

If you search this forum for mail send you should find several threads which will get you on the right track.

First thing you'll want to do is make a web page with the drop down lists in a form, and a send button. Just for starters, send that to a PHP script which just takes the values you want, as well as the senders email address, and prints them to the screen.

Once you've done that, it's a simple matter of using the mail() function in PHP.


The only hard part will be configuring the mail server, which if you're using a hosting service, will already be done for you.

-Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top