Jump to content

Error when sending mail.


jwk811

Recommended Posts

Was trying to send a simple test email to my self.. I used this script...
[code]<?php$to = "(myemail)";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: (myemail)";mail($to,$subject,$txt,$headers);
?>[/code]
And I uploaded it to the server and went to that page.. this was all that was displayed..
[quote]Parse error: parse error, unexpected T_VARIABLE in /home/content/j/w/k/jwk811/html/testemail.php on line 1
[/quote]
Does anyone know what this means or what I might of done wrong?
Link to comment
Share on other sites

<?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
Link to comment
Share on other sites

[quote author=jwk811 link=topic=109914.msg443463#msg443463 date=1159497403]
ok and what would i add to the script to redirect to another page?
[/quote]
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");
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.