button to send an email [message #179291] |
Tue, 02 October 2012 08:58 |
Jack of Hearts
Messages: 1 Registered: October 2012
Karma: 0
|
Junior Member |
|
|
Dear all,
I'm completely new to PHP but I think this is the right language to
solve my problem and I hope you can help me.
I want to add a form to my webpage to ask for an email address and the
submit button should send to such an address a preformed email.
I can write the form as
<form method="POST" enctype="text/plain">
e-mail: <input type="text" name="to">
<input type="submit" value="Get Result">
</form>
but I'm not able to get the data written in the form and prepare the
message using such data as the To: field of the message and of course I
can't send the message as well.
I imagine I've to write a PHP script to put on a server but I can't
write it and especially I don't know how to pass the data from the
webpage to such script.
Could you help me?
Thank you
Jack
--
|
|
|
Re: button to send an email [message #179292 is a reply to message #179291] |
Tue, 02 October 2012 09:07 |
Markus Sonnenberg
Messages: 2 Registered: May 2012
Karma: 0
|
Junior Member |
|
|
On 10/2/2012 10:58 AM, Jack of Hearts wrote:
> Dear all,
> I'm completely new to PHP but I think this is the right language to
> solve my problem and I hope you can help me.
>
> I want to add a form to my webpage to ask for an email address and the
> submit button should send to such an address a preformed email.
>
> I can write the form as
>
> <form method="POST" enctype="text/plain">
> e-mail: <input type="text" name="to">
> <input type="submit" value="Get Result">
> </form>
>
> but I'm not able to get the data written in the form and prepare the
> message using such data as the To: field of the message and of course I
> can't send the message as well.
>
> I imagine I've to write a PHP script to put on a server but I can't
> write it and especially I don't know how to pass the data from the
> webpage to such script.
>
> Could you help me?
>
> Thank you
>
> Jack
>
this could help you.
http://www.w3schools.com/php/php_mail.asp
regards
markus
ct,
--
Das Abspringen einer Begrenzungsmauer dient nicht dem direkten
Zurücklegen des Arbeitsweges.
http://www.rz-amper.de
|
|
|
Re: button to send an email [message #179293 is a reply to message #179291] |
Tue, 02 October 2012 11:52 |
Beauregard T. Shagnas
Messages: 154 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
Jack of Hearts wrote:
> Dear all,
> I'm completely new to PHP but I think this is the right language to
> solve my problem and I hope you can help me.
>
> I want to add a form to my webpage to ask for an email address and the
> submit button should send to such an address a preformed email.
>
> I can write the form as
>
> <form method="POST" enctype="text/plain"> e-mail: <input type="text"
> name="to"> <input type="submit" value="Get Result"> </form>
>
> but I'm not able to get the data written in the form and prepare the
> message using such data as the To: field of the message and of course I
> can't send the message as well.
I've always liked this example.
<http://safalra.com/programming/php/contact-feedback-form/>
Do be aware that your form could be used by malcontents, who could enter
someone else's email address for spamming and annoyance purposes. In my
email forms, I always have the form just send mail to me, then I reply
manually to the visitor. This may or may not fit your needs.
--
-bts
-This space for rent, but the price is high
|
|
|
Re: button to send an email [message #179302 is a reply to message #179293] |
Tue, 02 October 2012 19:23 |
houghi
Messages: 45 Registered: September 2011
Karma: 0
|
Member |
|
|
Beauregard T. Shagnasty wrote:
> Do be aware that your form could be used by malcontents, who could enter
> someone else's email address for spamming and annoyance purposes. In my
> email forms, I always have the form just send mail to me, then I reply
> manually to the visitor. This may or may not fit your needs.
I also look at it from the users point of view and then decide what
might be the best solution.
At work we use several forms between departments. The advantage is that
it is easy to fill out, people get the information in the same layout
and this impoves effeciency. Also it avoids information being forgotten,
e.g. account numbers or other information.
As an Internet user, I want to have what I send in my send items. Forms
does not offer me this ability. So a 'mailto' link is a better solution.
It can sill fill out the subject, so it is easy to filter. You can even
add your standard body.
Obviously with php these can be generated and can include e.g. cookie
information, so you have some way of knowing who the mail came from if
that is of importance.
It is also a LOT easier to do.
If you do decide on forms, rather use two different forms then one that
can handle two issues. See that there is as little information as
possible that needs to be filled out.
e.g. if people must be logged in, you do not need to ask their username
or email as you mhave that already.
Ask only information that is relevant and try not to have any 'free
entry' text fields. The complexer they become, the more people will use
it wrongly and the more counter productive they will become.
http://www.alistapart.com/articles/inline-validation-in-web-forms/ is
interesting as well.
houghi
--
How do you ask a man to be the last man to die in Iraq?
How do you ask a man to be the last man to die for a mistake?
|
|
|
Re: button to send an email [message #179304 is a reply to message #179292] |
Tue, 02 October 2012 21:01 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma: 0
|
Senior Member |
|
|
Markus Sonnenberg wrote:
> this could help you.
> http://www.w3schools.com/php/php_mail.asp
W3Schools.com in its current state is the cause for massive unlearning
later, and there is no indication that this could change. BTW, it has
nothing to do with the W3C. Avoid it if possible.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
|
|
|
Re: button to send an email [message #179305 is a reply to message #179302] |
Tue, 02 October 2012 21:25 |
Beauregard T. Shagnas
Messages: 154 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
houghi wrote:
> As an Internet user, I want to have what I send in my send items. Forms
> does not offer me this ability. So a 'mailto' link is a better solution.
> It can sill fill out the subject, so it is easy to filter. You can even
> add your standard body.
Mailto: perhaps in *addition to* a form. Never *instead of* a form. (for
normal public websites). Remember, with the proliferation of hotmail/gmail/
whoohoo only users, many people no longer even have a mail client for a
mailto to work.
--
-bts
-This space for rent, but the price is high
|
|
|