Results 1 to 13 of 13

Thread: Mail

  1. #1

    Thread Starter
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609

    Mail

    should this work? :
    PHP Code:
    mail ($form_to$form_subject$form_content); 

  2. #2
    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?

  3. #3

    Thread Starter
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    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

  4. #4
    scoutt
    Guest
    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");

  5. #5

    Thread Starter
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    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>

  6. #6
    scoutt
    Guest
    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>";
    }
    }
    ?>

  7. #7

    Thread Starter
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609
    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

  8. #8
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I'm surprised you didn't bring up issues of deprecation, scoutt.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  9. #9
    Member
    Join Date
    Apr 2002
    Posts
    52
    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.

  10. #10
    scoutt
    Guest
    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>"


    ?>

  11. #11
    Member
    Join Date
    Apr 2002
    Posts
    52
    i suppose that was for hobo?

  12. #12
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    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>"

    ?>
    ??
    My evil laugh has a squeak in it.

    kristopherwilson.com

  13. #13
    scoutt
    Guest
    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
  •  



Click Here to Expand Forum to Full Width