Jump to content

Archived

This topic is now archived and is closed to further replies.

jwk811

Error when sending mail.

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?

Share this post


Link to post
Share on other sites
its all scrunched together.
[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]
try that

Share this post


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

Share this post


Link to post
Share on other sites
Yeah Man No problem You got MSN?

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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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

Share this post


Link to post
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");

Share this post


Link to post
Share on other sites

×

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.