Jump to content


Photo

Error when sending mail.


  • Please log in to reply
10 replies to this topic

#1 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 29 September 2006 - 02:07 AM

Was trying to send a simple test email to my self.. I used this script...
<?php$to = "(myemail)";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: (myemail)";mail($to,$subject,$txt,$headers);
?>
And I uploaded it to the server and went to that page.. this was all that was displayed..

Parse error: parse error, unexpected T_VARIABLE in /home/content/j/w/k/jwk811/html/testemail.php on line 1

Does anyone know what this means or what I might of done wrong?

#2 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 29 September 2006 - 02:11 AM

its all scrunched together.
<?php
$to = "(myemail)";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: (myemail)";
mail($to,$subject,$txt,$headers);
?>
try that

#3 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 29 September 2006 - 02:13 AM

oh lol thank you ill try that and let you know in a sec what happens

#4 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 29 September 2006 - 02:15 AM

YES IT WORKED!!!!!!!!! IM SO HAPPY!!!! LOL thank you very much for you help im going to get started on working on this... thought it was too easy to be true and thats just what i need!  ;D :D

#5 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 29 September 2006 - 02:20 AM

Yeah Man No problem You got MSN?

email it to me on my spam email php4skill[at]gmail[dot]com

#6 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 29 September 2006 - 02:22 AM

ok thanks. and no ive got only AIM. could you tell me how and where to add a redirect or could I just make that page the redirect page instead?

#7 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 29 September 2006 - 02:28 AM

oh and does these email need to go through a server like the form processors do? cuz i need to know if the delays vary based on how many people try to send an email at once or whatever

#8 Demonic

Demonic
  • Members
  • PipPipPip
  • Advanced Member
  • 562 posts

Posted 29 September 2006 - 02:33 AM

oh im not sure mate. Don't have answer to tht one,but You might want to add a disclaimer saying about how you dont have any responsibility on how many users send an email.

#9 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 29 September 2006 - 02:36 AM

ok and what would i add to the script to redirect to another page?

#10 jwk811

jwk811
  • Members
  • PipPipPip
  • Advanced Member
  • 714 posts

Posted 29 September 2006 - 02:56 AM

<?php
$name = $_POST["name"];
$email = $_POST["email"];
$info = $_POST["info"];
$to = "(myemail)";
$subject = "Info";
$message = "$name, $info";
$headers = "From: $email" . "\r\n" .
mail($to,$subject,$txt,$headers);
?>

does this look like its set up right because im having just little bit of trouble, if this is right it must be the form

#11 doni49

doni49
  • Members
  • PipPipPip
  • Advanced Member
  • 515 posts
  • LocationCentral MO

Posted 01 October 2006 - 01:12 AM

ok and what would i add to the script to redirect to another page?

I assume you're wanting to thank the user for sending the email or something like that--that's what I think you meab by 'redirect to another page'.

header("Location:  thankyou.html");
Don




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users