help with email form

This is a discussion on help with email form within the PHP Language forums, part of the PHP Programming Forums category; On Aug 6, 7:30 pm, Loki25 <kgarnet...@gmail.com> wrote: > On Aug 6, 11:25 pm, ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 08-07-2007
alice
 
Posts: n/a
Default Re: help with email form

On Aug 6, 7:30 pm, Loki25 <kgarnet...@gmail.com> wrote:
> On Aug 6, 11:25 pm, alice <al...@fearofdolls.com> wrote:
>
> > > I'd recommend you use mail($to,$subject,$message,$head); instead- Hide quoted text -

>
> > > - Show quoted text -

>
> > That still isn't working.

>
> If you are running your own server, find your php.ini file and open it
> up. look for do a search for the SMTP section (using your editor's
> find command, it should be the first result)...you will see the
> mail_function block configuration block...should look something like:
>
> [mail function]
> ; For Win32 only.
> SMTP = <your SMTP server address>
>
> ; For Win32 only.
> sendmail_from = <your reply email address>
>
> ; For Unix only. You may supply arguments as well (default: "sendmail
> -t -i").
> ;sendmail_path =
>
> enter this information if it is not already there, save the file and
> restart your web server so the new settings take affect and try it
> again.


Could it be something wrong in the html?

<form action="mail.php" method="post"
onsubmit="MM_validateForm('email','','RisEmail');M M_validateForm('message','','R');return
document.MM_returnValue">
<p><label>Your email address:</label><br />
<input name="email" id="email" type="text" class="form" value=""
size="30" />
</p>
<p><label>Your message:</label><br />
<textarea name="message" id="message" value="message" cols="60"
rows="5" class="form"></textarea>
</p>
<input type="submit" name="submit" value="SEND" />

Reply With Quote
  #12 (permalink)  
Old 08-07-2007
Loki25
 
Posts: n/a
Default Re: help with email form

Your html looks fine, your php looks fine and since you are using a
hosting service, we can assume your settings are fine. I also tested
the PHP script on my own server just to be sure nothing was over
looked. I replaced the $to address and it worked fine for me. Since
the exact code works fine on my server it leads me to believe that the
problem isn't in the code and it is instead on the server side. It
could be something as simple as their SMTP server being down for a
short while.

Reply With Quote
  #13 (permalink)  
Old 08-08-2007
alice
 
Posts: n/a
Default Re: help with email form

On Aug 6, 11:43 pm, Loki25 <kgarnet...@gmail.com> wrote:
> Your html looks fine, your php looks fine and since you are using a
> hosting service, we can assume your settings are fine. I also tested
> the PHP script on my own server just to be sure nothing was over
> looked. I replaced the $to address and it worked fine for me. Since
> the exact code works fine on my server it leads me to believe that the
> problem isn't in the code and it is instead on the server side. It
> could be something as simple as their SMTP server being down for a
> short while.


I finally got the mail to send, but now whatever I enter in the
message window does not get sent.

Reply With Quote
  #14 (permalink)  
Old 08-08-2007
Geoff Muldoon
 
Posts: n/a
Default Re: help with email form

In article <1186532720.113030.138210@e9g2000prf.googlegroups. com>, alice
says...
> On Aug 6, 11:43 pm, Loki25 <kgarnet...@gmail.com> wrote:
> > Your html looks fine, your php looks fine and since you are using a
> > hosting service, we can assume your settings are fine. I also tested
> > the PHP script on my own server just to be sure nothing was over
> > looked. I replaced the $to address and it worked fine for me. Since
> > the exact code works fine on my server it leads me to believe that the
> > problem isn't in the code and it is instead on the server side. It
> > could be something as simple as their SMTP server being down for a
> > short while.

>
> I finally got the mail to send, but now whatever I enter in the
> message window does not get sent.
>
>

Are you using $message or $_POST['message']?

GM
Reply With Quote
  #15 (permalink)  
Old 08-08-2007
Jerry Stuckle
 
Posts: n/a
Default Re: help with email form

alice wrote:
> On Aug 6, 11:43 pm, Loki25 <kgarnet...@gmail.com> wrote:
>> Your html looks fine, your php looks fine and since you are using a
>> hosting service, we can assume your settings are fine. I also tested
>> the PHP script on my own server just to be sure nothing was over
>> looked. I replaced the $to address and it worked fine for me. Since
>> the exact code works fine on my server it leads me to believe that the
>> problem isn't in the code and it is instead on the server side. It
>> could be something as simple as their SMTP server being down for a
>> short while.

>
> I finally got the mail to send, but now whatever I enter in the
> message window does not get sent.
>


What's your current code, and what is in the variables you are passing
the mail() function?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Reply With Quote
  #16 (permalink)  
Old 08-09-2007
alice
 
Posts: n/a
Default Re: help with email form

On Aug 7, 6:16 pm, Geoff Muldoon <geoff.muld...@trap.gmail.com> wrote:
> In article <1186532720.113030.138...@e9g2000prf.googlegroups. com>, alice
> says...> On Aug 6, 11:43 pm, Loki25 <kgarnet...@gmail.com> wrote:
> > > Your html looks fine, your php looks fine and since you are using a
> > > hosting service, we can assume your settings are fine. I also tested
> > > the PHP script on my own server just to be sure nothing was over
> > > looked. I replaced the $to address and it worked fine for me. Since
> > > the exact code works fine on my server it leads me to believe that the
> > > problem isn't in the code and it is instead on the server side. It
> > > could be something as simple as their SMTP server being down for a
> > > short while.

>
> > I finally got the mail to send, but now whatever I enter in the
> > message window does not get sent.

>
> Are you using $message or $_POST['message']?
>
> GM


I'm not in front of it now, but I can see from my earlier post that
I'm using
$message.="message: ".$message."\n";

So should this be
$message.="message: "$_POST['message']"\n";

or, I'm guessing here, if I don't want the word Message: to be in the
email body it would be
$message.=$_POST['message']"\n";

Reply With Quote
  #17 (permalink)  
Old 08-10-2007
Loki25
 
Posts: n/a
Default Re: help with email form

On Aug 9, 1:07 pm, alice <al...@fearofdolls.com> wrote:
> On Aug 7, 6:16 pm, Geoff Muldoon <geoff.muld...@trap.gmail.com> wrote:
>
>
>
> > In article <1186532720.113030.138...@e9g2000prf.googlegroups. com>, alice
> > says...> On Aug 6, 11:43 pm, Loki25 <kgarnet...@gmail.com> wrote:
> > > > Your html looks fine, your php looks fine and since you are using a
> > > > hosting service, we can assume your settings are fine. I also tested
> > > > the PHP script on my own server just to be sure nothing was over
> > > > looked. I replaced the $to address and it worked fine for me. Since
> > > > the exact code works fine on my server it leads me to believe that the
> > > > problem isn't in the code and it is instead on the server side. It
> > > > could be something as simple as their SMTP server being down for a
> > > > short while.

>
> > > I finally got the mail to send, but now whatever I enter in the
> > > message window does not get sent.

>
> > Are you using $message or $_POST['message']?

>
> > GM

>
> I'm not in front of it now, but I can see from my earlier post that
> I'm using
> $message.="message: ".$message."\n";
>
> So should this be
> $message.="message: "$_POST['message']"\n";
>
> or, I'm guessing here, if I don't want the word Message: to be in the
> email body it would be
> $message.=$_POST['message']"\n";


if you were to do it that way, it would be: $message.=
$_POST['message']."\n"; (you were missing the [.])

Reply With Quote
  #18 (permalink)  
Old 08-12-2007
alice
 
Posts: n/a
Default Re: help with email form

On Aug 10, 9:25 am, Loki25 <kgarnet...@gmail.com> wrote:
> On Aug 9, 1:07 pm, alice <al...@fearofdolls.com> wrote:
>
>
>
>
>
> > On Aug 7, 6:16 pm, Geoff Muldoon <geoff.muld...@trap.gmail.com> wrote:

>
> > > In article <1186532720.113030.138...@e9g2000prf.googlegroups. com>, alice
> > > says...> On Aug 6, 11:43 pm, Loki25 <kgarnet...@gmail.com> wrote:
> > > > > Your html looks fine, your php looks fine and since you are using a
> > > > > hosting service, we can assume your settings are fine. I also tested
> > > > > the PHP script on my own server just to be sure nothing was over
> > > > > looked. I replaced the $to address and it worked fine for me. Since
> > > > > the exact code works fine on my server it leads me to believe that the
> > > > > problem isn't in the code and it is instead on the server side. It
> > > > > could be something as simple as their SMTP server being down for a
> > > > > short while.

>
> > > > I finally got the mail to send, but now whatever I enter in the
> > > > message window does not get sent.

>
> > > Are you using $message or $_POST['message']?

>
> > > GM

>
> > I'm not in front of it now, but I can see from my earlier post that
> > I'm using
> > $message.="message: ".$message."\n";

>
> > So should this be
> > $message.="message: "$_POST['message']"\n";

>
> > or, I'm guessing here, if I don't want the word Message: to be in the
> > email body it would be
> > $message.=$_POST['message']"\n";

>
> if you were to do it that way, it would be: $message.=
> $_POST['message']."\n"; (you were missing the [.])- Hide quoted text -
>
> - Show quoted text -


Now I'm getting a blank page after clicking submit, and no mail is
showing up. Here is the mail.php code, with the address x'd out.
<?php
$to="x@xxxxxx";
$subject="web email";
$email=$_POST["email"];

$message="web email\n";
$message=.$_POST['message']."\n";


$head="From: x@xxxxx";
mail($to,$subject,"".$message,$head);
header("Location:thankyou.html");
?>

Reply With Quote
  #19 (permalink)  
Old 08-13-2007
Loki25
 
Posts: n/a
Default Re: help with email form

On Aug 12, 3:29 pm, alice <al...@fearofdolls.com> wrote:
> On Aug 10, 9:25 am, Loki25 <kgarnet...@gmail.com> wrote:
>
>
>
> > On Aug 9, 1:07 pm, alice <al...@fearofdolls.com> wrote:

>
> > > On Aug 7, 6:16 pm, Geoff Muldoon <geoff.muld...@trap.gmail.com> wrote:

>
> > > > In article <1186532720.113030.138...@e9g2000prf.googlegroups. com>, alice
> > > > says...> On Aug 6, 11:43 pm, Loki25 <kgarnet...@gmail.com> wrote:
> > > > > > Your html looks fine, your php looks fine and since you are using a
> > > > > > hosting service, we can assume your settings are fine. I also tested
> > > > > > the PHP script on my own server just to be sure nothing was over
> > > > > > looked. I replaced the $to address and it worked fine for me. Since
> > > > > > the exact code works fine on my server it leads me to believe that the
> > > > > > problem isn't in the code and it is instead on the server side. It
> > > > > > could be something as simple as their SMTP server being down for a
> > > > > > short while.

>
> > > > > I finally got the mail to send, but now whatever I enter in the
> > > > > message window does not get sent.

>
> > > > Are you using $message or $_POST['message']?

>
> > > > GM

>
> > > I'm not in front of it now, but I can see from my earlier post that
> > > I'm using
> > > $message.="message: ".$message."\n";

>
> > > So should this be
> > > $message.="message: "$_POST['message']"\n";

>
> > > or, I'm guessing here, if I don't want the word Message: to be in the
> > > email body it would be
> > > $message.=$_POST['message']"\n";

>
> > if you were to do it that way, it would be: $message.=
> > $_POST['message']."\n"; (you were missing the [.])- Hide quoted text -

>
> > - Show quoted text -

>
> Now I'm getting a blank page after clicking submit, and no mail is
> showing up. Here is the mail.php code, with the address x'd out.
> <?php
> $to="x@xxxxxx";
> $subject="web email";
> $email=$_POST["email"];
>
> $message="web email\n";
> $message=.$_POST['message']."\n";
>
> $head="From: x@xxxxx";
> mail($to,$subject,"".$message,$head);
> header("Location:thankyou.html");
> ?>


Everything looks fine to me, I don't see anything wrong with your
code. But what I'm trying to figure out is the purpose of the empty
quotes just before the message in the mail function call. ("".$message)

Reply With Quote
  #20 (permalink)  
Old 08-14-2007
Tim Ferguson
 
Posts: n/a
Default Re: help with email form

Loki25 <kgarnett24@gmail.com> wrote in news:1186991766.268471.180630
@o61g2000hsh.googlegroups.com:

>> $message="web email\n";
>> $message=.$_POST['message']."\n";
>>

>


I think this should be

$message .= $_POST['message']."\n";


since the operator is .= not =.

Tim F
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:04 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0