doubt on sending mail

php India
  • 14 years ago
    In my program i need to send mail if the registration is success.
    in my file the total data is successfully inserted in the database
    but mail was not sent to the particular person.


     $from = '[email protected]';
            $subject = 'Activate your WLO trial account';
            $reply   = "<a href=\"http://wloconnect.com/site/activate_trial/index.php?userName='.$email.'&passWORD='.$random_password.'\">Click To Activate your WLO Trial Account>";
            $msg = "\r\n\r\nThank you $firstName for signing up for a trial account with WLO. Your trial account gives you access to our rate sheets and guidelines. This account will remain active for 30 days. \r\n\r\nYour login and password are \r\n\r\nLogin: $email \r\n\r\nPassword: $random_password \r\n\r\nYou must click the link below to activate your account \r\n\r\nhttp://wloconnect.com/site/activate_trial/index.php?userName=$email&passWORD=$db_password \r\n\r\nThis is an auto-generated Message. Please do not reply to this email.";

            // Send the message
     $ok = @mail($email, $subject, $msg, "From: <$from>");
          
    if ($ok) {
               echo '
               <br>
               <p class="table2ndBodyCopy">
               Thank you for signing up for a trial account with WLOconnect.com.
               </p>
               <p class="table2ndBodyCopy">
               You will recieve a email shortly with your new login name and your password.
               </p>
               <p class="table2ndBodyCopy">
               <b>You must click on the link in the email to activate your trial account.</b>
               </p>
               <br>
              ';
             }
             else {
               echo '
               <br>
               <p class="table2ndBodyCopyError">
               Temporarily unable to create account!
               </p>
               <br>
               ';
             }

    Here i am directly go to else part.

    please give the solution.
    for sending the mail we need any changes in the apache (httpd.conf) and php.ini files.
















































Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In order to understand recursion, one must first understand recursion.”