Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9254159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:23:48+00:00 2026-06-18T11:23:48+00:00

I need to send an automated mail after each registration and within the message

  • 0

I need to send an automated mail after each registration and within the message variable, I’ll need to run a while loop of all the product registered for.

Here is the code:

<?php


$message = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Course booking mail</title>
<style type="text/css">.course_list_tbl {border:1px solid #BAC2CC;}</style></head>
<body marginheight="0" topmargin="0" marginwidth="0" leftmargin="0" style="margin: 0px; background-color: #eee; background-repeat: repeat; color:#56667d; font-size:14px;">
<table cellspacing="0" border="0" cellpadding="0" width="100%"><tr><td>
<table width="650" cellspacing="0" cellpadding="0" border="0" align="center" style="border-width: 3px; border-color: #ffffff; border-style: solid;">
  <tr><td style="background:#F3F3F3; border-bottom:1px solid #BAC2CC;">
<table width="650" border="0"><tr><td>
<img src="http://www.og-softskills.com/gcom/images/ogs_mail.png" style="margin:0; margin-left:10px; margin-top: 4px; display: block;" alt="" />
</td>
    <td style="color:#2a186e;"><h2>Altous Solutions</h2></td>
  </tr></table></td></tr>
  <tr>
    <td style="background:#c8cfd8; color:#2a186e;" valign="middle"><h3 style="text-shadow: #ffffff 0px 1px 0px; margin-left:10px;">Your Order Information</h3></td>
  </tr>
  <tr><td style="padding:5px 10px;">
    <p>
    Course Booking Successfully Completed! You have successfully registered 3 candidate for 2 Open Courses and also booked for 1 In-house Course. Thank You!
    </p>
    </td></tr><tr><td>
    <h4 style="margin-left:25px; margin-bottom:0px;">Open Course</h4>
    <table width="600" border="0" cellspacing="0" cellpadding="0" align="center" class="course_list_tbl">
  <tr>
    <th scope="col" class="course_list_tbl" width="5%">s/n</th>
    <th scope="col" class="course_list_tbl">Course</th>
    <th scope="col" class="course_list_tbl">Actions</th>
  </tr>';

$message .= if($pubc_row_count > 0){
    $pub_sn = 1;

while($get_pubc_bookings_info_row = @mysql_fetch_assoc($get_pubc_bookings_info_query)){

$org_id = user_info('id');

$get_pubc_bk_id = $get_pubc_bookings_info_row['booking_id'];
$get_pubc_c_id = $get_pubc_bookings_info_row['course_id'];  
$get_pubc_c_title = $get_pubc_bookings_info_row['title'];

 echo '<tr><td>'.$pub_sn.'</td> <td>'.$get_pubc_c_title.'</td><td class="bk_action_lnk"><a href="pubc_reg_invoice.php?bk_id='.$get_pubc_bk_id.'&amp;org_id='.$org_id.'&amp;c_id='.$get_pubc_c_id.'" target="_blank">Print Invoice</a> <a href="pubc_invoice_pdf.php?bk_id='.$get_pubc_bk_id.'&amp;org_id='.$org_id.'&amp;c_id='.$get_pubc_c_id.'" target="_blank">Invoice in PDF</a> <div class="clear"></div></td></tr>';

++$pub_sn;

}

};

$message .= '</table></td>/tr>
  <tr>
    <td style="padding:5px 10px;">
    <p>
    For further enquiries, contact us via: <br /> 909-804-6416, 555-330-4541 <br /> Email: training@altous.com 
    </p>
    </td></tr>
    <tr>
    <td align="center" style="border-top:2px solid #BAC2CC; border-bottom:2px solid #BAC2CC;">
    <p  style="font-size:12px;"><strong style="font-weight:bold;">Altous Solution</strong> <br>
 5th Floor, Pole Plaza.</p>
    </td>
  </tr></table></td></tr></table></body></html>';


?>

It’s very certain, this will not fly cos appending the if statement and while loop within the variable “message” will hit a brick wall with the syntax error there. So I’m really blank on how to get this done.

Would appreciate some help with this…Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:23:49+00:00Added an answer on June 18, 2026 at 11:23 am
    <?php
    
    
    $message = 'part of string';
    
    if(some condition){
       $message  .= 'Other part of string';
    }
    
    while(some condition){
        $message  .= $var.'Other part of string';
    }
    
    echo $message; // will give you ful string
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to work on an application able to send a mail with automatic
We need send h264 from flash to Wowza and after to vlc by RTSP
I need send certain attributes(say, human readable user name) from server to client after
I need to send some information on a VxWorks message queue. The information to
I've a custom form (created with form API) that need send an uploaded file
I need to send video stream between 2 mobile devices. Bada has no support
I need to send instant messages (like forum PMs) between users with my asp.net
I need to send an HTML report with images from an application. The report
I need to send some bytes over UDP Protocol the start squence is 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF
I need to send some arguments from the iPhone to a php in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.