PHP Script: Will not send activation email

Discussion in 'PHP' started by worldman, Dec 7, 2010.

  1. #1
    I have a PHP Login Script that I have gotten to work except for one part, it does not send the activation email when I include a URL in the message. Here is the piece of code I have. Could someone please tell me what is wrong. Thanks :)

    mail ( $email , 'Registration Confirmation' , 'Thanks for registering. Your confirmation code is attached below http://www.college9.net/activate.php?code=' , $code );
    PHP:

     
    worldman, Dec 7, 2010 IP
  2. rainborick

    rainborick Well-Known Member

    Messages:
    424
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    120
    #2
    There is a problem with the last part of your code. I believe that
    
    , $code
    
    Code (markup):
    should be
    
    . $code
    
    Code (markup):
     
    rainborick, Dec 7, 2010 IP
  3. Simple Management

    Simple Management Peon

    Messages:
    39
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I assume $code doesn't contain headers information ?

    mail($email, 'Registration Confirmation', 'Thanks for registering. Your confirmation code is attached below http://www.college9.net/activate.php?code=' . $code);
    PHP:
     
    Simple Management, Dec 7, 2010 IP
  4. CPAPubMichael

    CPAPubMichael Peon

    Messages:
    231
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try this:

    
    
      <?php
    
           $subject = "Subject here";
           $message = "Hello,
    
           Message can be here";
           $headers = "From: support@example.com" . "\r\n" . 
           "Reply-To: support@example.com" . "\r\n" . 
           "X-Mailer: PHP/" . phpversion();
              mail($email, $subject, $message, $headers);
    
       ?>
    
    
    PHP:
    Hope i helped.
     
    CPAPubMichael, Dec 7, 2010 IP