Author |
Message |
phryxus
Junior WebHelper
Joined: 16 Nov 2003
Posts: 46
|
Posted:
Sat Jan 24, 2004 5:37 pm (20 years, 11 months ago) |
|
I created a mail form and it just won't work. He doesn't give an error, but when you try to send an e-mail I doesn't get receive one.
This is the form (PS. the variable names are Dutch!):
Code: |
<FORM name="contact" action="./handle_form.php" method=post>
<FONT class="text_bold">Name</FONT><BR>
<INPUT type="text" name="naam" size=30><BR>
<FONT class="text_bold">E-mail</FONT><BR>
<INPUT type="text" name="email" size=30><BR>
<FONT class="text_bold">Comments</FONT><BR>
<TEXTAREA name="commentaar" cols="40" rows="7"></TEXTAREA><BR>
<INPUT type="submit" name="submit" size="30" value="Send">
<INPUT type="reset" name="reset" size="30" value="Reset">
</FORM>
|
This is the script that handles the form:
Code: |
<?php
// verwerking form
$naam = trim ("$naam");
$email = trim ("$email");
$commentaar = trim ("$commentaar");
$email = "From: $email";
// verzenden form + message
if (mail ("contact@phryxus.nl", $naam, $email, $commentaar) ) {
print ("<FONT class=text_bold>$naam,</FONT><BR><FONT class=text>Thank you for sending your email! We will contact you as soon as possible.</FONT>\n");
} else {
print ("Your e-mail hasn't been send! Please try again.\n");
}
?>
|
THNKZ for your time,
Phryxus |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Sat Jan 24, 2004 5:49 pm (20 years, 11 months ago) |
|
|
|
|
phryxus
Junior WebHelper
Joined: 16 Nov 2003
Posts: 46
|
Posted:
Sat Jan 24, 2004 7:23 pm (20 years, 11 months ago) |
|
Ah, thnx! I'm still a rooky with PHP. |
|
|
|
|
tomda
Junior WebHelper
Joined: 23 Jan 2004
Posts: 6
Location: Nairobi
|
Posted:
Mon Jan 26, 2004 6:05 am (20 years, 11 months ago) |
|
Also, you may need to find out from your server the mail function that they are using as for example, my server doesn't recognize the mail() function. I should use email () instead (see below)
Fast copy and paste to help you :
<?php
if (!empty($ton)){ //check if email address field is empty
$from="webmaster";
$sujet="A friend ($na) sent you this page ";
$msg="A friend ($na) has sent you this email. Follow the link below and blah blah";
if(!email($from,$ton,$sujet,$msg))
{echo "<span id=dSc>The email has not been send. Please contact the administrator.<br><a href='javascript:window.close()'>Close the window</a>.<hr align='center' noshade size='2' width='650'>";}
else {echo "<span id=dSc>The email has been sent. <br>";
echo "<a href='javascript:window.close()'>Close the window</a> or send this page to another person.<hr align='center' noshade size='2' width='650'>";}}
Tommy |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Mon Jan 26, 2004 6:16 am (20 years, 11 months ago) |
|
Hosts who use that function are rare - I presume you are hosted at online.fr? |
________________________________
|
|
|
|
tomda
Junior WebHelper
Joined: 23 Jan 2004
Posts: 6
Location: Nairobi
|
Posted:
Mon Jan 26, 2004 7:13 am (20 years, 11 months ago) |
|
>> Hosts who use that function are rare - I presume you are hosted at online.fr?
Indeed Daniel !
Que penses-tu de leur service ?
En tout cas leur prix bas toute concurrence (si je ne me trompe pas) ?
Tommy |
|
|
|
|
phryxus
Junior WebHelper
Joined: 16 Nov 2003
Posts: 46
|
Posted:
Mon Jan 26, 2004 2:52 pm (20 years, 11 months ago) |
|
thnx 4 u're help. I've got him working
I'm not really sure what the problem was! I think the problem was that I didn't used the right possitions in my mail tag. |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Mon Jan 26, 2004 5:42 pm (20 years, 11 months ago) |
|
tomda: Ce que j'ai lu sur leur service n'était pas trop positif, alors j'ai préféré aller ailleurs, d'autant plus que j'ai besoins de services qui ne sont pas disponibles chez eux. Par ailleurs je n'ai pas le temps de modifier tous mes scripts pour utiliser la fonction email() (je ne vois pas pourquoi je m'amuserais à les modifier à chaque changement d'hébergeur!), donc hors de question d'aller chez eux. A mes débuts sur le web, j'y avais tout de même pensé . Enfin à part ça leur offre à l'air tout à fait correcte . |
________________________________
|
|
|
|
SfCommand
Senior WebHelper
Joined: 10 Nov 2002
Posts: 143
Location: UK
|
Posted:
Mon Jan 26, 2004 10:30 pm (20 years, 11 months ago) |
|
|
|
|
tomda
Junior WebHelper
Joined: 23 Jan 2004
Posts: 6
Location: Nairobi
|
Posted:
Tue Jan 27, 2004 8:35 am (20 years, 11 months ago) |
|
Sorry for that Sfcommand... I now it is to have post in other language than English but we were speaking about the services of a French server.
Tommy |
|
|
|
|
|
Page generation time: 0.129195 seconds :: 17 queries executed :: All Times are GMT
Powered by
phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme