Results 1 to 2 of 2

Thread: Email

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2003
    Location
    Auckland
    Posts
    1,139

    Email

    Why does this not send??

    PHP Code:
    // Enter info into the Database. 
    $info2 htmlspecialchars($info); 
    $sql mysql_query("INSERT INTO users (first_name, last_name, email_address, 
            username, password, info, signup_date) 
        VALUES('
    $first_name', '$last_name', '$email_address', 
            '
    $username', '$db_password', '$info2', now())") or die (mysql_error()); 

    if(!
    $sql){ 
        echo 
    'There has been an error creating your account. Please contact the webmaster.'
    } else { 
        
    $userid mysql_insert_id(); 
        
    // Let's mail the user! 
        
    $subject "Your Membership at MyWebsite!"
        
    $message "Dear $first_name $last_name
        Thank you for registering at our website, [url]http://www.mydomain.com[/url]! 
         
        You are two steps away from logging in and accessing our exclusive members area. 
         
        To activate your membership, please click here: 
        [url]http://www.mydomain.com/activate.php?id=[/url]
    $userid&code=$db_password 
         
        Once you activate your memebership, you will be able to login with the following 
        information: 
        Username: 
    $username 
        Password: 
    $random_password 
         
        Thanks! 
        The Webmaster 
         
        This is an automated response, please do not reply!"

         
        
    mail($email_address$subject$message
            
    "From: MyDomain Webmaster<[email protected]>\n 
            X-Mailer: PHP/" 
    phpversion()); 
        echo 
    'Your membership information has been mailed to your email address! 
         Please check it and follow the directions!'



    ?> 

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Check your syntax. The $message string should have all double quotes escaped with a backslash.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

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