|
-
Jun 5th, 2002, 07:13 AM
#1
Thread Starter
Fanatic Member
Mail
should this work? :
PHP Code:
mail ($form_to, $form_subject, $form_content);
-
Jun 5th, 2002, 08:55 AM
#2
Member
Why quotes? Wouldn't that just cause more overhead because the runtime environment would have to parse the strings?
BTW UB, why aren't you posting in the forum that you moderate?
-
Jun 5th, 2002, 09:00 AM
#3
Thread Starter
Fanatic Member
do i have to set up a POP3 or SMTP server for this to work ? or should it work standalone ?
BTW UB, why aren't you posting in the forum that you moderate?
- because i wated a little bit of a faster response time on this one
-
Jun 5th, 2002, 09:09 AM
#4
Originally posted by filburt1
Why quotes? Wouldn't that just cause more overhead because the runtime environment would have to parse the strings?
BTW UB, why aren't you posting in the forum that you moderate?
double quotes and no, so you can get the exact value of the string.
but if they are variables you don't need the quotes. only if they are in the regualar form.
mail("[email protected]", "the subject", $message,
"From: webmaster@$SERVER_NAME", "-fwebmaster@$SERVER_NAME");
-
Jun 5th, 2002, 09:13 AM
#5
Thread Starter
Fanatic Member
ERROR:
Warning: Failed to Connect in c:\windows\desktop\files\wwwroot\email.php on line 25
any idea what the problem could be ?
Here's the code if you want it:
PHP Code:
<html>
<head>
<title>My Little Email Page</title>
<style>
BODY, table
{font-family: verdana;
font-size: 11px;}
Input.submit,
Textarea.submit
{width: 200px;
font-family: tahoma;
font-size: 11px}
Textarea
{height: 100px}
</style>
</head>
<body>
<?PHP
IF (isset($action))
{
IF ($action == "sendmail")
{
//mail ( string to, string subject, string message)
mail ('$form_to', '$form_subject', '$form_content');
ECHO "would have been sent :)";
ECHO "<hr>";
}
}
?>
<b>Send an Email, <i>To</i> Anyone, <i>From</i> No one :)<b><br><br>
<form action="email.php?action=sendmail" method="post">
<input type="text" name="form_to"> - TO<br>
<input type="text" name="form_subject"> - Subject<br>
<textarea name="form_content"></textarea> - Message<br><br>
<input type="submit" value="Email">
</form>
</body>
</html>
-
Jun 5th, 2002, 09:19 AM
#6
are you running it off your server or a sites server? if your sever then you do have to setup smpt in the php.ini ifle and setup mail in httpd.conf file.
besides you will get parse errors on the img line, you forgot the to escape the "
<?PHP
IF (isset($action))
{
IF ($action == "sendmail")
{
//mail ( string to, string subject, string message)
mail ('$form_to', '$form_subject', '$form_content');
ECHO "would have been sent <img src=\"images/smilies/smile.gif\" border=\"0\" alt=\"\">";
ECHO "<hr>";
}
}
?>
-
Jun 5th, 2002, 09:28 AM
#7
Thread Starter
Fanatic Member
thanx scoutt, I'll give that a try.
BTW. i dont know where on earth that image code came from, its not in the source of the original file, and i havnt dealt with any images with that name for ages (months), Is strange
anyway, thanx
-
Jun 5th, 2002, 11:42 AM
#8
Stuck in the 80s
I'm surprised you didn't bring up issues of deprecation, scoutt.
-
Jun 5th, 2002, 12:36 PM
#9
Member
before you can use the mail function in PHP, u need to have a mail service running on the PC - on linux systems, it's there by default i think, but not on WinNT etc.
I may be re-stating things, but to make it clear - Single quotes pass as they are, Double quotes get parsed by PHP. So Single quotes don't overload, double qs do. U need to make a wise choice whether to use double qs or concatenate strings and the variables.
-
Jun 5th, 2002, 12:36 PM
#10
good point, why didn't I 
PHP Code:
<?PHP
IF (isset($_REQUEST['action'] == "sendmail"))
{
//mail ( string to, string subject, string message)
mail ('$form_to', '$form_subject', '$form_content');
ECHO "would have been sent <img src=\"images/smilies/smile.gif\" border=\"0\" alt=\"\">";
ECHO "<hr>";
}
}
?>
-
Jun 5th, 2002, 12:40 PM
#11
Member
i suppose that was for hobo?
-
Jun 5th, 2002, 12:41 PM
#12
Stuck in the 80s
Scoutt, don't you mean:
PHP Code:
<?PHP
IF (isset($_REQUEST['action'] == "sendmail"))
{
//mail ( string to, string subject, string message)
mail ($_REQUEST['form_to'], $_REQUEST['form_subject'], $_REQUEST['form_content']);
ECHO "would have been sent <img src=\"images/smilies/smile.gif\" border=\"0\" alt=\"\">";
ECHO "<hr>";
}
?>
??
-
Jun 5th, 2002, 12:42 PM
#13
yup
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|